Add Zero's to make two decimals. 
Author Message
 Add Zero's to make two decimals.

I have a trim function in which a text string and a monetary amount are
combined. The amount is derived by a calculation that rounds to two
decimals.

However, when the amount is a round figure, e.g. 5 or 5.1, I have found
no way of adding zero's to make them read 5.00 or 5.10

Does anybody know how to do this?

Grateful for any suggestions.



Fri, 26 Jan 2001 03:00:00 GMT  
 Add Zero's to make two decimals.
this should do it in VBA

Sub TestFormat()
MsgBox Format(5.1, "#.00")
End Sub



Quote:
>I have a trim function in which a text string and a monetary amount are
>combined. The amount is derived by a calculation that rounds to two
>decimals.

>However, when the amount is a round figure, e.g. 5 or 5.1, I have found
>no way of adding zero's to make them read 5.00 or 5.10

>Does anybody know how to do this?

>Grateful for any suggestions.



Fri, 26 Jan 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Dropping zeros after the decimal using Ccur()

2. extracting a decimal and zero filling a field

3. I can't add a key (index) on two fields using VB

4. Making VBA see bashful zeros

5. Howto always show two desimals even when last is zero

6. Excel Xp VBA - Pad SSN's w/Leading Zero's

7. TWO PROJECTS, TWO EXE'S, ONE INSTALL???

8. ASP Page's DLL's Use Count Not Going To Zero (or similar problem)

9. 'allow zero length' not working

10. Here's a sticky wicket - joining two tables on two diffrent servers with ADO

11. Rounding to two decimal places (Access 97)

 

 
Powered by phpBB® Forum Software