how to round up decimal values
i have a label and textbox with text amount,according to my scenarion what ever the value enter into textbox it should round up to 2 decimal values.
for example if end user enters 1234.432 then it should be 1234.43,if enduser enters 3456.45678 then it should be 3456.46
can u pleas esend me the required code for this
If you are using float type then following piece of code might be useful for you.
Suppose your value is 1.234 and you want it to be rouded of to 1.23
float f = 1.234;
f *= 100;
f = (float)Math.round(f)/100;
.... and now f==1.23