Hi ,
I wanted to add comma to a number
Could you please guide me here…
Example 7000 output 7,000
Thanks
Hi ,
I wanted to add comma to a number
Could you please guide me here…
Example 7000 output 7,000
Thanks
Hey @Rahul_S1
Check this out
@nikhil.girish thanks
Thanks @Shiva_Nikhil
maybe you are looking for this also
I assume it’s being stored in a string variable, and you want to output it as a string with the thousands separator as comma. (If it’s an integer or double variable, there is no such thing as a thousands separator)
To take a string and output it with thousands separator as comma:
myStr = 7000
CDBl(myStr).ToString("N0",System.Globalization.CultureInfo.InvariantCulture)
Don’t use string manipulation (ie insert) because it won’t work if the number is hundreds of thousands, millions, etc. Do proper conversion to a number datatype, then proper formatting expression.
Also, if you want decimal places you can change the number, ie N1 N2 N3 etc.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.