numfmt - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

MapleTA[Builtin]

  

numfmt

  

format a number according to a template

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

numfmt(format, number)

Parameters

format

-

string

number

-

numeric

Description

• 

The numfmt command uses a format template to specify how many digits after the decimal point to display among other things. The given number is matched against the template and a formatted string is returned.

• 

This command has the same specification as the built-in Java command, java.text.DecimalFormat.

Examples

MapleTA:-Builtin:-numfmt#.00,20.9

20.90

(1)

MapleTA:-Builtin:-numfmt#.#,12.34

12.3

(2)

MapleTA:-Builtin:-numfmt.#,12.34

12.3

(3)

MapleTA:-Builtin:-numfmt#.0000,12.3456789

12.3457

(4)

MapleTA:-Builtin:-numfmt#.010,12.3456

12.351

(5)

MapleTA:-Builtin:-numfmt#,12.34

12

(6)

MapleTA:-Builtin:-numfmt#.#,12.3456

12.3

(7)

MapleTA:-Builtin:-numfmt#.###,12.3456

12.346

(8)

MapleTA:-Builtin:-numfmt000.#,12.3456

012.3

(9)

Compatibility

• 

The MapleTA[Builtin][numfmt] command was introduced in Maple 18.

• 

For more information on Maple 18 changes, see Updates in Maple 18.

See Also

MapleTA

 


Download Help Document