Reply to thread

You first need to convert the string into a number which you can

work with, and then you can use the Round function to get it

to a certain decimal place. Consider this example:


[code=vb]

    Dim dNum As Double  Number before rounding

    Dim dNumRounded As Double  Number after rounding


    dNum = Double.Parse("14.52612")  Turn the String into a Double


    dNumRounded = Math.Round(dNum, 2)  Round it (the 2 is the # of decimal places to round)


    MessageBox.Show(dNumRounded.ToString)  Shows the results (should be "14.53")

[/code]


HTH


Back
Top