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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Number Value As String but need to add zeros

Status
Not open for further replies.

random621

Technical User
Jul 16, 2003
54
US
I have a field {table.price} that displays numbers such as below:
4.2
4.25
13.1
13.15
13

In need to display these number values as a string based on the following conversion:
4 = 0400
4.2 = 0420
4.25 = 0425
13.1 = 1310
13.15 = 1315
13 = 1300

{table.price} represents any value from 0.01 cents to 99.99 cents.

I've tried the simple cstr formula but that returns usually 4 or if I modify the number format I can get 4.20.

Your help is appreciated!
 
Random621,

Try:

totext(({table.price}*100),"0000")

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top