Formatting Numbers - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Create Maple Worksheets : Format Maple Worksheets : worksheet/expressions/numericformatting

Formatting Numbers

  

Numbers in your document can be formatted using the Numeric Formatting dialog. Maple supports the following standard numeric formats:

• 

Fixed

• 

Currency

• 

Scientific

• 

Engineering

• 

Percent

  

You can also create a Custom format, whereby you can format for accounting, dates, fractions, time, and more.

 

When to Use Numeric Formatting

The Numeric Formatting Dialog

Formatting Principles

Regional Settings for Currency

When to Use Numeric Formatting

  

Use the Numeric Formatting dialog 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.

  

You can also set the numeric formatting by creating a User Profile and applying it to a worksheet. For details, see User Profile and Create a User Profile.

The Numeric Formatting Dialog

• 

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

  

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:

• 

#.### formats to 3.12

• 

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.

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.

See Also

2-D Math

Command Completion

Create a User Profile

Document Mode

Options for Rounding and Display Precision

Overview of Palettes

type/float

type/integer

type/rational

Units

Units Formatting

User Profile

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam