Revision: 4887 http://sourceforge.net/p/vexi/code/4887 Author: mkpg2 Date: 2016-10-21 14:38:34 +0000 (Fri, 21 Oct 2016) Log Message: ----------- Add rounding mode arg.
Modified Paths: -------------- branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java Modified: branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java =================================================================== --- branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java 2016-10-14 16:53:02 UTC (rev 4886) +++ branches/vexi3/org.vexi-library.js/src/main/java/org/ibex/js/JSNumber.java 2016-10-21 14:38:34 UTC (rev 4887) @@ -116,7 +116,12 @@ String keyStr = JSU.toString(method); if("round".equals(keyStr)){ int scale = JSU.getArg_int(args, 0, 0); - return round(scale, RoundingMode.HALF_UP); + String modeStr = JSU.getArg_string(args, 1); + RoundingMode mode = RoundingMode.HALF_UP; + if(modeStr!=null){ + mode = RoundingMode.valueOf(modeStr); + } + return round(scale, mode); }else if("roundSF".equals(keyStr)){ int sigfigs = JSU.expectArg_int(args, 0); JS scaleJS = JSU.getArg(args, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn