| 12345678910111213141516171819 |
- /**
- * 价格数据截取
- * Num:截取值
- * type:截取类型 (Integer:整数部分,Decimals:小数部分)
- */
- export const numCapture = (Num : Number | String, type : 'Integer' | 'Decimals') => {
- let N_V = '';
- const N = Num || '0.00'
- const N_A = String(N).split('.');
- switch (type) {
- case "Integer":
- N_V = N_A[0] || '0';
- break;
- case "Decimals":
- N_V = N_A[1] || '00';
- break;
- }
- return N_V
- }
|