Skip to content

Instantly share code, notes, and snippets.

@rockonyu
Created July 11, 2018 10:09
Show Gist options
  • Save rockonyu/a21394e37f9439262dcd5619da063725 to your computer and use it in GitHub Desktop.
Save rockonyu/a21394e37f9439262dcd5619da063725 to your computer and use it in GitHub Desktop.
// 數字 X 左邊補零至 N 位數
// ex. X = 23, N = 4
("0000" + 23).slice(-4) // "0023"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment