decimal format in datalist c#
string.Format()
formatting numbers
Number formatting is culture dependant. For example, formatting a currency string on my laptop will return a result like £9.99, formatting a currency on a machine set for the US region would return $9.99.
more info see this link
formatting numbers
Number formatting is culture dependant. For example, formatting a currency string on my laptop will return a result like £9.99, formatting a currency on a machine set for the US region would return $9.99.
specifier | type | format | output (double 1.2345) | output (int -12345) |
---|---|---|---|---|
c | currency | {0:c} | £1.23 | -£12,345.00 |
d | decimal (whole number) | {0:d} | System.FormatException | -12345 |
e | exponent / scientific | {0:e} | 1.234500e+000 | -1.234500e+004 |
f | fixed point | {0:f} | 1.23 | -12345.00 |
g | general | {0:g} | 1.2345 | -12345 |
n | number | {0:n} | 1.23 | -12,345.00 |
r | round trippable | {0:r} | 1.23 | System.FormatException |
x | hexadecimal | {0:x4} | System.FormatException | ffffcfc7 |
<%# Eval("Price", "{0:C}") %>
String in double format
decimal format in datalist c#
Reviewed by Bhaumik Patel
on
6:24 AM
Rating: