Socket
Socket
Sign inDemoInstall

add-zero

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    add-zero

Add a leading zero to a number.


Version published
Weekly downloads
2K
decreased by-1.61%
Maintainers
1
Install size
5.57 kB
Created
Weekly downloads
 

Readme

Source

add-zero Build Status

Add a leading zero to a number.

Install

Via npm:

$ npm install add-zero --save

Via Bower:

$ bower install add-zero --save

Usage

var addZero = require('add-zero');

addZero(5); // 05
addZero(10); // 10
addZero(5, 3); // 005
addZero(100, 3); // 100
addZero(-5); // -05
addZero(-5, 3); // -005

API

addZero(value, [digits])

value

Type: number (integer) or string

Value in which a leading zero should be added to.

digits

Type: number
Default: 2

Total number of digits or decimal places.

License

MIT © Rafael Rinaldi

Keywords

FAQs

Last updated on 14 Aug 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc