arground

arground, function

def pure arground(a: number): number

Returns the number of decimal places to retain when displaying the input number a.

Examples

show summary "Roundings" a1a3 with
  arground(5.3001) as "of 5.3001"
  arground(5.30001) as "of 5.30001"
  arground(5.29998) as "of 5.29998"

Remarks

The rounding rule is as follows: if a sequence of 000 or 999 is found in the decimal expansion, the number is rounded for display. For example, arground(5.3001) and arground(5.2998) return 4, while arground(5.30001) and arground(5.29998) return 1.

User Contributed Notes
0 notes + add a note