You are not logged in.
Login
or
Register
.
JsPHP: a JavaScript library providing the PHP API
Home
Register
Demo
Categories
Functions
Contributors
Download
Links
Comments
FAQ
Contact
View
Edit
Benchmark
Revisions
Developers
Dependencies
Talk
Links
bcscale:
Edit: bcscale
Function:
bcscale
View bcscale
Edit bcscale
Edit code
Edit tests
Edit benchmark
View latest code
Edit latest code
Benchmark bcscale
Comment on bcscale
Comment on the latest code
View revisions
View versions
View contributors
View dependencies
View comments
View links
Download production code
Download development code
View the PHP docs
View phpjs.org
View phpjs.org raw code
Description:
Sets default scale parameter for all bc math functions.
Edit function
Code
:
function bcscale (scale) { // http://jsphp.co/jsphp/fn/view/bcscale // + original by: lmeyrick (https://sourceforge.net/projects/bcmath-js/)this. // - depends on: _phpjs_shared_bc // * example 1: bcscale(1); // * returns 1: 3 // @todo: implement these testcases // bcscale(0); // // bcmath.test.result('bcscale', 1, false, bcscale('fail')); // bcmath.test.result('bcscale', 2, false, bcscale(-1)); // bcmath.test.result('bcscale', 3, true, bcscale(5)); // bcmath.test.result('bcscale', 4, true, bcscale(0)); var libbcmath = this._phpjs_shared_bc(); scale = parseInt(scale, 10); if (isNaN(scale)) { return false; } if (scale < 0) { return false; } libbcmath.scale = scale; return true; }
You have to be logged in to edit functions.
Edit tests
Code
:
You have to be logged in to edit tests.
Edit benchmark
Code
:
You have to be logged in to edit benchmarks.
[
top
]
Comments
There are no comments yet, be the first!
Please
Login
or
Register
to post comments.