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

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -