跳到主要内容

DOLLARFR

将以小数表示的美元价格转换为以分数表示的美元价格。

语法

expression.DOLLARFR(arg1, arg2);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number一个小数。
arg2必需ApiRange | ApiName | number用于分数分母的整数。

返回值

number

示例

将十进制美元价格转换为其分数等值。

// Transform prices from decimal notation to fractional notation.

// Use the DOLLARFR function to convert decimal prices to fractional format.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.DOLLARFR(1.1875, 16));