Formatting Numbers
|
Numbers in your document can be formatted using the Number Format option in the context panel. Maple supports the following standard numeric formats:
|
|
You can also create a Custom format, whereby you can format for accounting, dates, fractions, time, and more.
|
|
When to Use Numeric Formatting
|
|
|
Use numeric formatting options to enhance your worksheet for presentation or illustrative purposes.
|
|
If you require computations with various units, see the Units package. The Units package contains commands for unit conversion and provides environments for performing calculations with units.
|
|
|
The Numeric Formatting Options
|
|
•
|
Numeric formatting can be applied to either a worksheet or to the output of an execution group.
|
•
|
When you apply a numeric format to a worksheet, the current execution group and any new execution group will have the numeric format applied to them. Existing execution groups keep their original formatting.
|
•
|
When you apply a numeric format to an execution group, the output of the execution group will have the numeric format applied to it.
|
•
|
Numeric formatting is always applied to floats.
|
•
|
You can select whether or not to apply numeric formatting to integers, rational numbers, and exponents.
|
•
|
You can apply either a standard numeric format or a custom numeric format.
|
|
Standard Numeric Formatting Using Format Menu Options
|
|
|
To apply a standard numeric format:
|
1.
|
Place the cursor in the output of the execution group to be formatted.
|
2.
|
From the Format menu, select Numeric Formatting. The Numeric Formatting dialog opens.
|
3.
|
From the Category group box, select a format. If you select Custom, enter a string.
|
4.
|
Select from the Apply to integer, Apply to rational and Apply to exponent check boxes.
|
5.
|
Do one of the following:
|
•
|
Click Apply And Set As Default to apply the format to the current execution group and to any new execution group created in the worksheet.
|
•
|
Click Apply if you want to apply the format to the current execution group.
|
|
|
Custom Numeric Formatting
|
|
|
To apply a custom format:
|
1.
|
Place the cursor in the output of the execution group to be formatted.
|
2.
|
From the Format menu, select Numeric Formatting. The Numeric Formatting dialog opens.
|
3.
|
Select a format from the Category list and then select Custom. The custom string field displays a string from the last selected format. Alternatively, you can immediately select the Custom option from the Category list. The custom string field is blank, but you can enter a string that is specific to your formatting needs.
|
|
Examples include the following:
|
•
|
00.000 formats to 03.120
|
•
|
#,#.# formats to 2,100,320.5
|
•
|
$0.00 formats to $123.50
|
•
|
??0.00;[Red](??0.00) formats to blue for a positive number, and red for a negative number
|
•
|
[<10]Low;[>=100]High;Medium formats to "Low" for numbers less than 10,"High" for numbers less than or equal to 100, and "Medium" otherwise
|
4.
|
Select from the Apply to integer, Apply to rational and Apply to exponent check boxes.
|
5.
|
Do one of the following:
|
•
|
Click Apply And Set As Default if you want to apply the custom format to the current execution group and to any new execution group created in the worksheet.
|
•
|
Click Apply if you want to apply the custom format to the current execution group.
|
|
|
Numeric Formatting Using the Context Panel Options
|
|
You can apply a standard or custom numeric format using the Context Panel instead of using the Format menu.
|
To apply a standard numeric format using the context panel:
|
1.
|
Click the output of the execution group to be formatted to display the context panel.
|
2.
|
In the context panel, under the Number Format heading select a format.
|
3.
|
Depending on the numeric format you selected in the previous step, you may have additional menu options to select (for example, if you selected Currency as a numeric format, you may also enter the number of decimal places, select a currency symbol, and select how you want negative numbers to be displayed).
|
4.
|
Click back on the worksheet or document to see your numeric formatting changes.
|
|
|
|
Formatting Principles
|
|
•
|
A new execution group maintains the formatting of the group that was active at time of creation.
|
•
|
Formatting is applied to all numbers in an execution group, even if separated by semicolons.
|
•
|
When formatting a complex number, formatting is applied only to the real and imaginary parts.
|
•
|
To display a rational number as currency, for example 1/3 as $0.33, you must select the Apply to rational check box.
|
|
|
Regional Settings for Currency
|
|
|
In international versions of the Maple application, default formatting uses commas to separate decimals and decimals to separate thousands as per regional settings (for example, $10.000,00).
|
|
However, custom strings must use commas for thousands and decimal points for decimals places.
|
|
|
|
|
|
|