web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
405 B

  1. "use strict";
  2. var pad = require("../../string/#/pad")
  3. , toPosInt = require("../to-pos-integer")
  4. , toFixed = Number.prototype.toFixed;
  5. module.exports = function (length/*, precision*/) {
  6. var precision;
  7. length = toPosInt(length);
  8. precision = toPosInt(arguments[1]);
  9. return pad.call(
  10. precision ? toFixed.call(this, precision) : this, "0",
  11. length + (precision ? 1 + precision : 0)
  12. );
  13. };