/** * 工具类 */ /** * 字符串填充 * @param type sting 填充左侧还是右侧 * @param sourceStr string 原字符串 * @param len number 填充后长度 * @param charStr string 填充的字符 * @returns string */ export declare const strPad: (type: 'left' | 'right', sourceStr: string, len: number, charStr: string) => string; export declare const transformShortNum: (num: any, decimal?: number, addUnit?: boolean, retInt?: boolean) => string | number; export declare const formatTime: (time: number, format: string, allowEmpty?: boolean) => string; /** * 特定类型数字的统一格式处理 * @param num 需要转换的数字(非数字 或是 - 将直接返回 -) * @param decimal 返回的小数位 * @param addUnit 返回值是否添加单位:(万或亿) * @param retInt 当数据小于1万时,是否返回无小数位的整数 */ export type FormatType = 'yuan' | 'fen' | 'decimalToPercentSave2Decimal' | 'percentSave2Decimal' | 'percentSave0Decimal' | 'decimalToPercentSave0Decimal' | 'int' | 'decimal' | 'text' | 'secToTimeMS' | 'secToTime' | 'secToTimeChMS' | 'secToTimeHM'; export declare const formatData: (config: { type: FormatType; value?: any; afterUnit?: string; beforeUnit?: string; isAbs?: boolean; }) => any;