Formatting numbers is right-aligned while keeping the currency symbol left-aligned

Is there a native FormatString format or a way to use a custom FormatString:
$ 150.00
$ 1,170.00
$ 12,170.00
$ 90.00
$ 38.00
$ 750.00

And format them like this:

$ 150.00
$ 1,170.00
$ 12,170.00
$ 90.00
$ 38.00
$ 750.00

without knowing the greatest value? This is in a gridview boundcolumn I am in encoding on a rowdatabound going through existing rows to get the biggest one and change the current one if necessary, or change the existing ones if the current one is the biggest, so I had a workaround, but was hoping for a clean solution.

+3
2

, , , . ...

+3

, , , .

? , , .

   $150.00
 $1,170.00
$12,170.00
    $90.00
    $38.00
   $750.00
+1

Source: https://habr.com/ru/post/1715326/


All Articles