Hi everyone! i just wanna ask for the right syntax in rounding off numbers to the nearest tens... for example... 93.18 becomes 93... 98.4 becomes 100..... i try to use the syntax round(epression) but i can just round off numbers into whole number... please help... thanks!
- If you need clarification, ask it in the comment box above.
- Better answers use proper spelling and grammar.
- Provide details, support with references or personal experience.
Tell us some more! Your answer needs to include more details to help people.You can't post answers that contain an email address.Please enter a valid email address.The email address entered is already associated to an account.Login to postPlease use English characters only.
Tip: The max point reward for answering a question is 15.
Use the Math.Round() function. It takes two arguments, the first is your number or a variable holding your number and the second is the number of decimal places. This will only round to fractions of a whole number though and you need to round to the nearest 10. So divide your number by 10 before you round to shift the decimal place once to the left and multiply by 10 again afterwards to shift it back again.