Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding off / forcing zeros to show..

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
When rounding off a figure to 3 decimel places, if the figure last decimel place is a 0, then it doesn't display. Is there a way to force zeros to display?

ie: +12.98 is what is shown, but +12.980 is what i want it to show..



Cheers,

Paul
basepointdesignzltd..
P4 3.0Ghz / 1.25GB RAM
XP Pro SP2
Sapphire X1950 512MB Dual-DVi Graphics Card..
 
Try:
Code:
Debug.Print Format(12.98, "#####[blue]0.000[/blue]")


Have fun.

---- Andy
 
format(12.98,"+0.000;-0.000")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
+12.98 was just an example, the figure will be different in all cases. Can i just replce the +12.98 bit with the variable name?
ie:
Code:
Debug.Print Format(Y, "#####0.000")



Cheers,

Paul
basepointdesignzltd..
P4 3.0Ghz / 1.25GB RAM
XP Pro SP2
Sapphire X1950 512MB Dual-DVi Graphics Card..
 
format(Y,"+0.000;-0.000")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top