a format question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ned White

    a format question

    Hi All,

    when i use "{0:#,#.##} " format string for decimal values it seems like that;
    12,1457 --12,15
    45,4119 --45,41

    but for one decimal digit values it does not show zero after first decimal
    digit.
    12,4000 --12,4
    78,8000 --78,8
    45,5000 --45,5

    are there any format string to show zero after decimal digit like that;
    12,4000 --12,40
    78,8000 --78,80
    45,5000 --45,50

    Thanks ..

    White..



  • Martin Honnen

    #2
    Re: a format question

    Ned White wrote:
    Hi All,
    >
    when i use "{0:#,#.##} " format string for decimal values it seems like that;
    12,1457 --12,15
    45,4119 --45,41
    >
    but for one decimal digit values it does not show zero after first decimal
    digit.
    12,4000 --12,4
    78,8000 --78,8
    45,5000 --45,5
    >
    are there any format string to show zero after decimal digit like that;
    12,4000 --12,40
    78,8000 --78,80
    45,5000 --45,50
    I think you want
    "{0:#,##0.0 0}"


    --

    Martin Honnen --- MVP XML

    Comment

    Working...