vb.net - String 3 decimal places -


example 1

dim mystr string = "38" 

i want result 38.000 ...


example 2

mystr = "6.4" 

i want result 6.400


what best method achieve this? want format string variable atleast three decimal places.

use formatnumber:

dim mystr string = "38" msgbox(formatnumber(cdbl(mystr), 3))  dim mystr2 string = "6.4" msgbox(formatnumber(cdbl(mystr2), 3)) 

Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -