AccountingForm¶
Formats a number in accounting notation: like NumberForm, but negative
numbers are shown in parentheses instead of with a minus sign.
A second argument gives the number of significant figures. Requesting fewer
figures than the number has integer digits pads the trailing digits with zeros
and emits the reqsigz warning.
$ wo 'ToString[AccountingForm[1234.5678, 3]]'
AccountingForm::reqsigz: Requested number precision is lower than number of digits shown; padding with zeros.
1230.
A {n, f} spec fixes the digits after the decimal point. The closing bracket
takes a column of its own, so a padded fraction is one slot wider than f:
NumberSigns replaces the brackets:
A list is formatted element-wise: