DIR Return Create A Forum - Home
---------------------------------------------------------
BotBitsand Nix
HTML https://botsbitsandnix.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: javascript
*****************************************************
#Post#: 34--------------------------------------------------
for you sciency nerds
By: Nixsy Date: June 29, 2020, 9:13 am
---------------------------------------------------------
this in the code block is my scientific notation remover
[code]function scientific(n) {
n = String(n);
var info = /([\d\.]+)e-(\d+)/i.exec(n);
if (!info) {
return n;
}
var num = info[1].replace('.', ''),
numDecs = info[2] - 1;
var output = "0.";
for (var i = 0; i < numDecs; i++) {
output += "0";
}
output += num;
return output;
}[/code]
you see this bit of code it is gpl3
HTML https://www.gnu.org/licenses/gpl-3.0.en.html
*****************************************************