Why is it that when I convert a string with value “22.882” to double, using Dbl() it loses precision and is converted to 2288.2?
I have to use a double since I’m using the constructor of System.Web.UI.WebControls.Unit
(see http://msdn.microsoft.com/en-us/library/ctewx7ch.aspx).
There is no apparent reason why it would change the value to
2288.2, but if it actually ends up as22882.0then you are just using a culture that doesn’t use period as decimal separtor.You just have to specify a culture that does use the period as decimal separator: