How to convert 3 to 3.0

Hi everyone,

I need to format a column from excel where whenever I encountered a whole number, it will automatically be converted to a float, for example, 2 → 2.0, and 3 → 3.0. I have tried both using Convert.ToDouble and double.parse, no luck.

Any help would be grateful.

1 Like

Hi @jadepu2010,

Welcome to the Community.

Please use convert.todecimal or cdbl(xxxx)

image

1 Like

image

This is what I have done, but the result is still 3, not 3.0.

1 Like

Hi @jadepu2010,

Give assign size = Oz.tostring(“0.00”)

1 Like

Thanks, cdbl works.

1 Like

and Oz.tostring(“0.00”)works too

1 Like

Your welcome. :smiley:

Please mark the rite answer as solution

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.