Remove Decimal Places

  • Thread starter Thread starter Harry
  • Start date Start date
H

Harry

Hi,

Does anyone know how to remove decimal places?
ie: I have 334.43 and I need it to be displayed as 33443.

Sounds simple enough, but I cant seem to find anything that works!

I have tried various ToString(x) formats, but no joy as yet.

Thanks in advance.
H
 
float f = 334.43f;
string s = f.ToString().Replace('.', '');

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top