MCPcopy Create free account
hub / github.com/microsoft/SandDance / splitIntoBaseAndExponent

Function splitIntoBaseAndExponent

docs/tests/v2/es6/js/sanddance.js:747–767  ·  view source on GitHub ↗
(number)

Source from the content-addressed store, hash-verified

745}
746
747function splitIntoBaseAndExponent(number) {
748 var base = number;
749 var exponent = 0;
750
751 if (number !== 0) {
752 while (base >= 10 || base <= -10) {
753 base /= 10;
754 exponent++;
755 }
756
757 while (base < 1 && base > -1) {
758 base *= 10;
759 exponent--;
760 }
761 }
762
763 return {
764 base: base,
765 exponent: exponent
766 };
767}
768
769function getSISuffix(multipleOf3) {
770 var SI_SUFFIXES = {

Callers 1

formatSIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected