Skip to content
October 6, 2025
  • Use Personal Access Token for Github
  • Windows Equivalent of Linux ‘tail’ Command
  • Linux Mint: How to Activate Night Light
  • Portainer: How to Fix “Unable to retrieve image details”

Colek Colek

writing for living

Newsletter
Random News
  • Home
  • Donate
  • Contact
Headlines
  • Use Personal Access Token for Github

    9 months ago9 months ago
  • Windows Equivalent of Linux ‘tail’ Command

    1 year ago1 year ago
  • Linux Mint: How to Activate Night Light

    1 year ago1 year ago
  • Portainer: How to Fix “Unable to retrieve image details”

    1 year ago1 year ago
  • Ubuntu: How to Troubleshoot High CPU in MySQL

    2 years ago1 year ago
  • MySQL: How to Count Duplicated Records

    3 years ago3 years ago
  • Home
  • Javascript

Javascript

  • Javascript
  • Open Source
  • Programming
  • Tutorial

Pad Number with Leading Zero in Javascript

kumkum15 years ago1 year ago01 mins mins

The following function will pad number with leading zero(es). function pad(number, length) { var str = ” + number; while (str.length < length) { str = ‘0’ + str; } return str; } Some code to test the function: document.write(pad(1, 1) + ”); document.write(pad(1, 2) + ”); document.write(pad(15, 2) + ”); document.write(pad(1, 3) + ”);…

Read More

CATEGORIES

  • Android
  • Coldfusion
  • Container
  • Database
  • Debian
  • Docker
  • FreeBSD
  • Git
  • HTML
  • Internet
  • Javascript
  • Linux
  • MacOS
  • MySQL
  • Networking
  • Open Source
  • PHP
  • Programming
  • Security
  • Smartphone
  • SQL
  • Tips and Tricks
  • Trading
  • Tutorial
  • Ubuntu
  • Windows
  • Wireless
  • Wordpress
  • Yii2

Subscribe

Blogroll

  • Inti Delta Ekaprana
  • PT ARBI
  • Stem Cell Assays

Tags

backup bandwidth monitor bandwidth speed container debian dmg2iso docker excerpt get first image github google analytics highcpu imageantialias() insert using select JpGraph linux mint mysql network speed nighlight personalaccesstoken php php-mcrypt different version phpfox portainer powershell redshift root rsync samsung galaxy S III screen SetAntiAliasing shell script sql sql server 2005 squeeze ssh tail timezone token top twitter uptime windowstail wordpress
Newsmatic - News WordPress Theme 2025. Powered By BlazeThemes.