success success - 1 year ago 76 Question

Show extra decimal place as Double in

I tried to display the temperature. I set the temperature to be a double, when I get a temperature, e.g. 77 F, I really want to display 77.0 but I do not know how to do it? Thanks.

Wei Wei
Answer Source

Use the format specifier F

Dim Temperature As Double
Temperature = 77
Console.WriteLine(Temperature.ToString("F1", CultureInfo.InvariantCulture))

Will display 77.0

See Microsoft documentation

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download