开发者

How can I round.max excel in JavaScript?

开发者 https://www.devze.com 2023-01-27 00:29 出处:网络
Does anyone know if the开发者_JS百科re is a round.max Excel function but in JavaScript. Tnx.Math.ceil(x)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号