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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top