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!

Formula for converting decimal number to fixed length string 1

Status
Not open for further replies.

bhujanga

Programmer
Oct 18, 2007
181
US
I have numbers in this format:
5.24
37.128
124.7
i.e. various decimal places and magnitudes, but always less than 1000.
I want to convert them to strings that are 5 characters long that include leading zeroes and retain two decimals of accuracy.
So the above numbers would be:
00524
03713
12470

Is there a good straightforward formula for such a conversion?
 
hi,

Result starting in A1...
[pre]
5.24 00524
37.128 03713
124.7 12470
[/pre]

Formula:
[tt]
B1: =TEXT(ROUNDUP(A1*100,0),"00000")
[/tt]


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top