Hello,
I have the following values in strings
- 124.98765
- 113.450988
But i only want 124.987, 113.450 , just till the 3rd decimal point.
I have to use split string but iβm having trouble writing the code for it.
Thank you for the help.
Hello,
I have the following values in strings
But i only want 124.987, 113.450 , just till the 3rd decimal point.
I have to use split string but iβm having trouble writing the code for it.
Thank you for the help.
You can split the string based on . and use substring method to get those 3 characters after dot.
Or you can use Math.Round(value,3) method
Can you tell the split string code for it please ?
Hi @Yugal_Raju
try this way,
this will give the round of your input
Math.Round(CDbl(β124.98765β),3)
Math.Round(CDbl(β113.450988β),3)
try another way if you donβt want round of
Math.Floor(CDbl(β124.98765β) * 1000) / 1000
Math.Floor(CDbl(β113.450988β) * 1000) / 1000
Regards,
Gowtham K
Math.Round is the best practice here.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.