From 33784376667560bd3927a03d5811173ba9aeabc5 Mon Sep 17 00:00:00 2001 From: KarthikaSF4773 Date: Mon, 24 Nov 2025 19:28:50 +0530 Subject: [PATCH 1/2] 988545-DisplayCurrencySymbol --- .../Working-with-Cell-or-Range-Formatting.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md b/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md index 89a094af2..5949f55d9 100644 --- a/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md +++ b/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md @@ -919,6 +919,52 @@ workbook.DetectDateTimeInValue = False {% endhighlight %} {% endtabs %} +N> To display the **$** symbol, apply a currency or accounting number format. Using a plain number format shows only the numeric value and omits the currency symbol. + +{% tabs %} +{% highlight c# tabtitle="C# [Cross-platform]" %} +//Plain number format +sheet.Range["A1"].Number = 100; +sheet.Range["A1"].NumberFormat = "0.00"; //shows 100.00 + +//Currency format +sheet.Range["A2"].Number = 1234.56; +sheet.Range["A2"].NumberFormat = "$#,##0.00"; //shows $1,234.56 + +//Accounting format +sheet.Range["A3"].Number = 234; +sheet.Range["A3"].NumberFormat = "_($* #,##0.00_)"; //shows $ 234.00 +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +//Plain number format +sheet.Range["A1"].Number = 100; +sheet.Range["A1"].NumberFormat = "0.00"; //shows 100.00 + +//Currency format +sheet.Range["A2"].Number = 1234.56; +sheet.Range["A2"].NumberFormat = "$#,##0.00"; //shows $1,234.56 + +//Accounting format +sheet.Range["A3"].Number = 234; +sheet.Range["A3"].NumberFormat = "_($* #,##0.00_)"; //shows $ 234.00 +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Plain Number format +sheet.Range("A1").Number = 100 +sheet.Range("A1").NumberFormat = "0.00" 'shows 100.00 + +'Currency format +sheet.Range("A2").Number = 1234.56 +sheet.Range("A2").NumberFormat = "$#,##0.00" 'shows $1,234.56 + +'Accounting format +sheet.Range("A3").Number = 234 +sheet.Range("A3").NumberFormat = "_($* #,##0.00_)" 'shows $ 234.00 +{% 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. From 6b1839595d63630fd6164b16ba3f2b7996f8ac72 Mon Sep 17 00:00:00 2001 From: MOHAN CHANDRAN <93247949+Mohan2401@users.noreply.github.com> Date: Thu, 27 Nov 2025 10:46:40 +0530 Subject: [PATCH 2/2] Update Working-with-Cell-or-Range-Formatting.md --- .../NET/Working-with-Cell-or-Range-Formatting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md b/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md index 5949f55d9..4c0e33bea 100644 --- a/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md +++ b/Document-Processing/Excel/Excel-Library/NET/Working-with-Cell-or-Range-Formatting.md @@ -919,7 +919,7 @@ workbook.DetectDateTimeInValue = False {% endhighlight %} {% endtabs %} -N> To display the **$** symbol, apply a currency or accounting number format. Using a plain number format shows only the numeric value and omits the currency symbol. +N> To display the **$** symbol, apply a currency or accounting number format. Using a number format without any currency symbol does not show any currency symbol in the value. {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} @@ -2172,4 +2172,4 @@ A complete working example to apply rich text formatting in C# is present on [th The output of the previous code is shown as follows: -![Excel document with rich-text formatting](Working-with-Cell-or-Range-Formatting_images/Working-with-Cell-or-Range-Formatting_img6.jpeg) \ No newline at end of file +![Excel document with rich-text formatting](Working-with-Cell-or-Range-Formatting_images/Working-with-Cell-or-Range-Formatting_img6.jpeg)