ASH84

Software Engineer/Developer, co-founder of Payhere. Ex-Banksalad. Intereseted in iteroperability, bootstrap company, writting.

[js] jquery-number 3자리 금액 쉼표(,) 찍기

created:2015-03-18
updated:2017-03-28
edit

서버 단에서 해도 되겠지만, 프론트 단에서 괜찮은 라이브러리가 있어서 소개한다. 3자리마다 금액 숫자에서 쉼표를 찍는 라이브러리인데 쓰기가 쉬워서 메모해 놓는다.

[https://github.com/customd/jquery-number](https://github.com/customd/jquery-number)
### Basic number formatting The number method takes up to four parameters, but only the first one is required. 1. Number: The number you want to format.
$.number( 5020.2364 ); // Outputs 5,020
  1. Decimal Places: The number of decimal places you wish to see. Defaults to 0.
$.number( 5020.2364, 2 ); // Outputs: 5,020.24
  1. Decimal Separator: The character(s) to use as a decimal separator. Defaults to ‘.’.
$.number( 135.8729, 3, ',' ); // Outputs: 135,873
  1. Thousands Separator: The character(s) to use as a thousands separator. Defaults to ‘,’.
$.number( 5020.2364, 1, ',', '' ); // Outputs: 5 020,2


#3자리 금액 자바스크립트  #dev  #jQuery  #jquery-number  #JS  #통화