mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 10:14:16 +08:00
convert: common/utils/formatNumber
This commit is contained in:
parent
79bdff96c1
commit
f1e574d843
|
@ -5,10 +5,7 @@
|
|||
* @example
|
||||
* formatNumber(1234);
|
||||
* // 1,234
|
||||
*
|
||||
* @param {Number} number
|
||||
* @return {String}
|
||||
*/
|
||||
export default function formatNumber(number) {
|
||||
export default function formatNumber(number: number): string {
|
||||
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
}
|
Loading…
Reference in New Issue
Block a user