Skip to content

935933-Explain the behavior of number format detection based on System culture in Excel #1114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: hotfix/hotfix-v29.1.33
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,14 @@ workbook.DetectDateTimeInValue = false;
workbook.DetectDateTimeInValue = False
{% endhighlight %}
{% endtabs %}

## Number Format Detection Behavior Based on System Culture

In Microsoft Excel, when a value is inserted, the system's culture settings determine whether the value is interpreted as a [Text](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IRange.html#Syncfusion_XlsIO_IRange_Text) or [Number](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IRange.html#Syncfusion_XlsIO_IRange_Number). If it is a valid number according to the current culture, Excel automatically detects and applies a corresponding number format.

For example, **205,206** is recognized as a [Number](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IRange.html#Syncfusion_XlsIO_IRange_Number) in en-US culture because the comma acts as a thousands separator, whereas **10,2** is treated as [Text](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IRange.html#Syncfusion_XlsIO_IRange_Text) since it does not match the numeric format of the default culture.

However, in **XlsIO**, number formats are not automatically detected when assigning values. If you want to preserve specific formatting (such as numbers with thousands separators or custom decimal formats), you must explicitly set the number format for the cell or range. This ensures that the value is correctly interpreted and displayed as intended in the resulting Excel document.

## Hide Cell Content by setting Number Format

Expand Down