framework/js/lib/utils/format-number.js
2015-05-30 08:40:29 +09:30

4 lines
102 B
JavaScript

export default function(number) {
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}