I have numerous numeric values, some with 1 and some with 2 decimal places (1.2 or 1.23).
I changed a textbox textformat option (in designer) from general to number and the numbers display with 2 decimal digits.
I can't change the number of decimal digits to 1 unless I untick the uselocalsetting option.
However if I do this then I lose the localisation selections for decimal and group separators.
Can I change the number of decimal places whilst still retaining localisation of decimal and group separators, etc.
What's the best way?
Many thanks
Ian
Correct way to format a numeric value
-
- Posts: 37
- Joined: Wed Oct 11, 2006 3:44 am
Correct way to format a numeric value
In this kind of case I use the various ToString methodes in the OnGetValue event
if (MyCondition == 1)
e.Value = MyNumber.ToString("#,#0.0");
else
e.Value = MyNumber.ToString("#,#0.00");
I hope that helps.
if (MyCondition == 1)
e.Value = MyNumber.ToString("#,#0.0");
else
e.Value = MyNumber.ToString("#,#0.00");
I hope that helps.
Correct way to format a numeric value
Select CustomFormat and type format string - #,#0.00
Thank you.
Thank you.