Scientific notation XAML

前端 未结 2 1544
执笔经年
执笔经年 2021-01-27 17:06

I\'m using scientific notation in XAML. I do:


The problem is that

2条回答
  •  抹茶落季
    2021-01-27 17:18

    I believe you should use the G format specifier to get (almost) what you want.

    
    

    Within a certain range (different for different number types, see link) the number will then be displayed in normal notation. For large or small enough values, the values will be displayed without trailing zeroes and 2 exponent digits.

    Examples for float:

    1340000  => 1340000
    13400000 => 1.34e+07
    0.00054  => 0.00054
    0.000054 => 5.4e-05
    

提交回复
热议问题