import { IFormatCurrentPair, InstrumentProps } from "@shared/types/interface"; import { getDecimalNumber } from "@utils/FormatNumber"; export const formatPair = (item: InstrumentProps) => { const { lotSize, ctVal, tickSize } = item; const newItem: IFormatCurrentPair = { ...item, leverageScale: 0, // 数量精度 lotSizeScale: getDecimalNumber(lotSize), // 面值精度 ctValScale: getDecimalNumber(ctVal), // 价格精度 tickSizeScale: getDecimalNumber(tickSize), // 价格步长 tickSizeStep: 1, /** 成本精度 */ costSizeScale: 4 }; return newItem; };