Mar 2, 2004 #1 Y yewmeng Well-known member Joined Dec 16, 2003 Messages 46 hi all let say i have a decimal value 12.314 i just want to show 12.31 so how to convert it please help me thx in advance
hi all let say i have a decimal value 12.314 i just want to show 12.31 so how to convert it please help me thx in advance
Mar 2, 2004 #2 bri189a Well-known member Joined Sep 11, 2003 Messages 1,004 Location VA C#: double myVal myVal = 12.318; myVal = Math.Round(myVal, 2); Code: Dim myVal As Double myVal = 12.318 myVal = Math.Round(myVal, 2)
C#: double myVal myVal = 12.318; myVal = Math.Round(myVal, 2); Code: Dim myVal As Double myVal = 12.318 myVal = Math.Round(myVal, 2)
Mar 3, 2004 #3 AlexCode Well-known member Joined Jul 7, 2003 Messages 931 Location Portugal Just note that ROUND will actually "round" your value. This mean that if the value is 1.38, ROUND(1.38,1)=1.4 if you dont wish to actually round the number something else must be made... Alex
Just note that ROUND will actually "round" your value. This mean that if the value is 1.38, ROUND(1.38,1)=1.4 if you dont wish to actually round the number something else must be made... Alex
Mar 4, 2004 #4 K kas Member Joined Feb 24, 2004 Messages 23 Location Lincoln, England You can limit the display of digits using one of the string formatters: eg. Label1.Text = Amount.ToString("F") - will display just two decimal places.
You can limit the display of digits using one of the string formatters: eg. Label1.Text = Amount.ToString("F") - will display just two decimal places.
Mar 4, 2004 #5 AlexCode Well-known member Joined Jul 7, 2003 Messages 931 Location Portugal Usually I use the Substring for that... Alex