@melonproject/token-math
Version:
A small helper library to do precision safe calculations
10 lines (9 loc) • 475 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const normalize_1 = __importDefault(require("./normalize"));
const toFixed_1 = __importDefault(require("../quantity/toFixed"));
const toFixed = (price, decimals = 6) => toFixed_1.default(normalize_1.default(price).quote, decimals);
exports.default = toFixed;