formatting

  • Thread starter Thread starter ptet
  • Start date Start date
P

ptet

I wish to change how a number is formatted depending upon
its value,

eg 0 to 1 2 decimal places

1 to 10 one decimal place


10 t0 100 no decimals


any ides within a code for on format???
 
You cannot get a variable format like that using the Format property of a
text box or field.

It would be possible to use the Format() function to ouput a text version of
the field that displays it like that. Use IIf() statements embedded inside
each other to handle the different ranges, and remember the possibilities of
negatives. It might be easier to write a function using Select Case to
output the string you need.

In the end, you will have text (not Number): okay for display, but not ideal
for performing calculations. And of course all this relates only to the
display, so does not resolve any rounding problems.
 
Back
Top