Call me Ishmael.

프론트엔드

iOS 더블탭 등 액션 막기

CSS 상에서 액션을 막아버리는 방법이 있다.

touch-action에 대해서는 기능이 많으므로 추가적인 공부가 필요함.

1touch-action: *manipulation*;

가격 표시하기

 1toLocaleString()
 2toLocaleString(locales)
 3toLocaleString(locales, options)
 4
 5var number = 123456.789;
 6
 7// request a currency format
 8console.log(number.toLocaleString('de-DE', { style: 'currency', currency: 'EUR' }));
 9// → 123.456,79 €
10
11// the Japanese yen doesn't use a minor unit
12console.log(number.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY' }))
13// → ¥123,457
14
15// limit to three significant digits
16console.log(number.toLocaleString('en-IN', { maximumSignificantDigits: 3 }));
17// → 1,23,000
18
19// Use the host default language with options for number formatting
20var num = 30000.65;
21console.log(num.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}));
22// → "30,000.65" where English is the default language, or
23// → "30.000,65" where German is the default language, or
24// → "30 000,65" where French is the default language

천의 자리 단위로 쉼표 끊어줄 때 사용.

10000000 → 10,000,000

문자열 텍스트인 경우 parseInt 를 거쳐야 한다.