Reputation: 1359
I have a task to deliver a numeric/decimal value as part of a fixed length text file. These values will take the following form:
10 chars, w/last 5 chars representing the decimal portion of the string. These will all be positive numbers.
A few examples:
0.123 = "0000012300" 1.0 = "0000100000" 123.456 = "0012345600" 234 = "0023400000"
The numeric data resides in an Access database formatted as numbers (double).
My current thought is:
Can anyone suggest a reasonable approach to produce the necessary 10 character TEXT conversion?
Thanks!
Upvotes: 1
Views: 97
Reputation: 123799
Perhaps just multiply by 100000 and format?
Format(x * 100000, "0000000000")
Upvotes: 3