我必须拼写excel中的数字,但我需要将美分形式设为“xx / 100” 防爆。 3,258.63 =“三千两百五十八百六十一百只”
现在我的宏功能是
typedef struct stack_elem
{
int val;
struct stack_elem *next;
} Stack;
//struct that contains the pointer to the top of the stack
typedef struct
{
int num; //num of elements in stack
Stack *top;; //top of stack
} TopStack;
但是这也给了我关于分数的拼写,我怎么能以50/100的格式留下数字?
非常感谢您的帮助
答案 0 :(得分:0)
这有助于获得分数部分。
Right(FormatCurrency(MYNUMBER, 2), 2) & "/100"
答案 1 :(得分:0)
' POSITION OF DECIMAL PLACE 0 IF NONE.
DECIMALPLACE = INSTR(MYNUMBER, ".")
' CONVERT CENTS AND SET MYNUMBER TO DOLLAR AMOUNT.
IF DECIMALPLACE > 0 THEN
CENTS = RIGHT(FORMATCURRENCY(MYNUMBER, 2), 2) & "/100"
MYNUMBER = TRIM(LEFT(MYNUMBER, DECIMALPLACE - 1))
END IF
感谢@Barney,小数函数能够显示为 50/100(例如)