Remove decimal and leave 00

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I remove the decimal point from fixed numbers but leave the double
zero after the decimal. Currently I am using the Replace() command but if
there are two zeros after the decimal it drops them; I need them to remain.

Currently
495.25 = 49525
495.00 = 495

Need
495.00 = 49500

Thanks,
Scott
 
Scott said:
How do I remove the decimal point from fixed numbers but leave the double
zero after the decimal. Currently I am using the Replace() command but if
there are two zeros after the decimal it drops them; I need them to remain.

Currently
495.25 = 49525
495.00 = 495

Need
495.00 = 49500


Replace(Format(numberfield, "0.00"), ".", "")
 
How do I remove the decimal point from fixed numbers but leave the double
zero after the decimal. Currently I am using the Replace() command but if
there are two zeros after the decimal it drops them; I need them to remain.

Currently
495.25 = 49525
495.00 = 495

Need
495.00 = 49500

Thanks,
Scott

Replace() works on text fields. If this is a Number, just multiply it
by 100 rather than replacing the decimal point.

John W. Vinson[MVP]
 
That would work for the 495.00, changing it to 49500 but it wouldn't work for
the 495.25, changing it to 4952500.

Scott
 
That was simple!

Thank you,
Scott

John Vinson said:
Replace() works on text fields. If this is a Number, just multiply it
by 100 rather than replacing the decimal point.

John W. Vinson[MVP]
 
495.25 * 100 = 49525

In other words, don't strip out the decimal point before you multiply.
 
I'm confused at how him telling you to multiply by 100 was different than me
telling you to multiply by 100.
::Shrug::
 
You might also want to be curious that this is the right answer. In the
original post, he said that if the value was 495.00 he wanted to see 495,
not 49500. It's all very confusing to me!

I would have thought the answer would be to format the thing to two places,
then strip the trailing zeros, then remove the decimal point.

Tom Ellison
 
Dear Tom,

So, I'm not the only one that misreads posts.

In the first post the OP said he/she was getting 495, but wanted to get
49500.

Quote
Currently
495.25 = 49525
495.00 = 495

Need
495.00 = 49500
End Quote
 
Back
Top