2014-10-10 60 views
-1

我找不到NumberFormat將千位分隔符與小數點轉換爲小數點分隔符並用逗號。SpreadSheetGear - 如何使用逗號將十進制和十進制分隔符轉換爲千位分隔符?

Worksheet.Range(NumberRange).NumberFormat = "#.##0,00" 

這不適合我。請幫忙。

感謝

+0

可能重複的[FormatNumber替換使用SpreadsheetGear DLL的逗號小數](http://stackoverflow.com/questions/26294796/formatnumber-replace-decimal-with-comma-using-spreadsheetgear-dll) – pnuts 2014-10-10 15:46:58

+0

可能重複的[使用電子表格(.Net)爲Excel單元格本地化值](http://stackoverflow.com/questions/26292451/localizing-value-for-excel-cell-using-spreadsheetgear-net) – pnuts 2014-10-10 15:48:51

回答

0

做到這一點的唯一方法是告訴Excel中的小數和千位分隔符是不同的,但是這會影響整個應用程序不只是一個特定的細胞或工作表/工作簿。

代碼:

With Application 
    .DecimalSeparator = "," 
    .ThousandsSeparator = "." 
    .UseSystemSeparators = False 
End With 
0

請參閱回答here

簡而言之,數字組和小數點分隔符由所使用的CultureInfo對象控制。首次加載工作簿時,您需要指定正確的CultureInfo。

相關問題