269.4052867128178 -> 269.4 how?

  • Thread starter Thread starter Jeroen Ceuppens
  • Start date Start date
J

Jeroen Ceuppens

Hi, i want to have a conversion from 269.4052867128178 -> 269.4 (so it has
only one number after the point)

The type of the number is long

Thx
JC
 
Jeroen Ceuppens said:
Hi, i want to have a conversion from 269.4052867128178 -> 269.4 (so
it has only one number after the point)

The type of the number is long

This should get you what you want:

double myVar = 269.4052867128178;
string result = myVar.ToString("0.0");
 
Jeroen Ceuppens said:
Hi, i want to have a conversion from 269.4052867128178 -> 269.4 (so it has
only one number after the point)

The type of the number is long

If the type of the number is long, you don't have any decimal places at
all. Could you check that?
 
Back
Top