Display currency with variable decimal places

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to display currency (i.e. including the $ sign) in a text box
but truncate any trailing zeros after the second decimal place? I need up to
four decimal places, but do not want to show trailing zeros after the second
decimal place. That is, I want to be able to display each of these examples:

$10.7438
$9.24 (two trailing zeros hidden)
$7.20 (one trailing zero displayed to ensure correct currency format; two
trailing zeros hidden)
 
Is there a way to display currency (i.e. including the $ sign) in a
text box but truncate any trailing zeros after the second decimal
place?

set the property in the textbox's design:

Format = "\$0.00"

Hope that helps


Tim F
 
Brian said:
Is there a way to display currency (i.e. including the $ sign) in a text box
but truncate any trailing zeros after the second decimal place? I need up to
four decimal places, but do not want to show trailing zeros after the second
decimal place. That is, I want to be able to display each of these examples:

$10.7438
$9.24 (two trailing zeros hidden)
$7.20 (one trailing zero displayed to ensure correct currency format; two
trailing zeros hidden)


Just specify a custom format in the text box's Format
property. Check Format property in Help for the various
codes that can be used. I think you want something like:

$#,##0.00##
 
Back
Top