1234567891011121314151617181920 |
- /*
- * @Author: code4eat awesomedema@gmail.com
- * @Date: 2022-12-14 14:14:32
- * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-06-08 15:27:39
- * @FilePath: /BudgetManaSystem/src/utils/format.ts
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
- // 示例方法,没有实际意义
- export function trim(str: string) {
- return str.trim();
- }
- //金额数字转换
- export function formatMoneyNumber(num:number) {
- if (typeof num !== 'number' || isNaN(num)) {
- return '-';
- }
- return new Intl.NumberFormat('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 2 }).format(num);
- }
|