How can I round.max excel in JavaScript?
Does anyone know if the开发者_JS百科re is a round.max Excel function but in JavaScript.
Tnx.
Math.ceil(x)
Edit. If you want to specify the precision, apply some basic math:
function roundup(x, digits) {
var m=Math.pow(10, digits);
return Math.ceil(x*m)/m;
}
Also see: Math.round()
, Math.floor()
If by "round.max" you meant ROUND(MAX())
, then you'll want Math.max()
:
Math.max(x, y, z, ...)
Math.max.apply(null, someArray)
I'm not exactly sure what you are trying to accomplish (I don't use Excel a lot), but w3schools.com has an amazing database full of all the functions used in JavaScript. I would be very surprised if you didn't find what you are looking for, and quickly at w3schools.com.
-Hope this helps! If you have any questions, let me know.
精彩评论