Question Hanging Decimal Point

salcorn

New member
Local time
Today, 05:05
Joined
Apr 20, 2009
Messages
2
I have been trying to format a field that has some values with decimals some without to look like this: 12 34 56.78 or 12 34 56

If I put "00 00 00.##" it leaves the decimal if there is no decimal place, but if I put "00 00 00" it will round the values with a decimal.

12 34 56 -> 12 34 56.
12 34 56.78 -> 12 34 57

I have looked for the answer in several places and have been unable to find anything. Is there a way to optionally add a decimal into a number format?

Thanks,
Sam
 
Convert the number to a string then format it in code.
Infact create a function, pass the floating point number to it and return a string.
 
Out of curiosity I thought that numbers were numbers per sa. Did not know you could have spaces in numbers 12 34 56 78.90??
 
Thanks for the tip. Here's what I came up with:

Format([Division],IIf(Int([Division])<>[Division],"00 00 00.00","00 00 00"))

It seems to be working for now. I tried to use Mod but there must have been a rounding error.

FYI, the reason I needed the numbers to be formatted with spaces is because it is an organizational system for architectural products. The standard is to use two digit groupings to narrow the product type down.

The value is still stored as a number, but displayed as a string for clarity. I didn't use text because I wanted it to be easier to narrow the list to a certain category. The 09 division is now everything that is between 90000 and 99999.

Thanks again.
 
Out of curiosity I thought that numbers were numbers per sa. Did not know you could have spaces in numbers 12 34 56 78.90??
David you are quite correct. Numbers are numbers per se. However you can display them in whatever format you like.
 

Users who are viewing this thread

Back
Top Bottom