i have seen this following math method called:
Math.round(d*10000) / (double) 10000;
and i don't know what it means. can someone please explain me ? thank you
Assuming d
is a double
or float
. It multiplies d
with 10000
. Rounds to the nearest whole number, and divides by 10000
If effect, it returns the original number with '4 digits as decimal fraction' (without resorting to formatting to String and parsing)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.