M
Markus
Hi all,
two questions on formatting numbers:
- Given is a decimal/money datatype in SQL-Server, e.g.
decimal(9,4), thus displaying a value like 13.2000
How can I prevent to display the unnecessary zeros at the end?
Is it only possible with a custom Formatter? Or is there a built-in
functionality in the Framework? I just found decimal.ToString("F2"),
which forces e.g. 2 numbers after the decimal-point.
My desired result as an example:
value -> display
13.2000 -> 13.2
13.0000 -> 13
13.2220 -> 13.222
...
- How can I format a number to fill zeros at the beginning?
Again an example, which shows my desired results:
value -> display
1 -> 00001
202 -> 00202
14321 -> 14321
...
thx for any input
Markus
two questions on formatting numbers:
- Given is a decimal/money datatype in SQL-Server, e.g.
decimal(9,4), thus displaying a value like 13.2000
How can I prevent to display the unnecessary zeros at the end?
Is it only possible with a custom Formatter? Or is there a built-in
functionality in the Framework? I just found decimal.ToString("F2"),
which forces e.g. 2 numbers after the decimal-point.
My desired result as an example:
value -> display
13.2000 -> 13.2
13.0000 -> 13
13.2220 -> 13.222
...
- How can I format a number to fill zeros at the beginning?
Again an example, which shows my desired results:
value -> display
1 -> 00001
202 -> 00202
14321 -> 14321
...
thx for any input
Markus