CP104 Lecture Notes - Lecture 10: Decimal Mark, Scientific Notation
hayjayshay and 38575 others unlocked
2
CP104 Full Course Notes
Verified Note
2 documents
Document Summary
From right to left the formatting code elements are: type. Multiplies the value by 100 and displays the result as a percent. Displays a best fit to the type of value being printed, with up to 12 decimal points for a floating point (real number) value. The number of decimal places to display for a floating point (real number) value. Tells the format to use a comma as a thousands separator. width. Width includes decimals and commas except for floating point (real number) values where precision is not specified. sign. Controls the placement of positive/negative signs in front of numbers. Displays a sign for both positive and negative numbers. Displays a minus sign only for negative numbers. space. Displays a minus sign for negative numbers and a space for positive numbers. none. The alignment character that defines whether the output value is to be left aligned, right aligned, or centred. Displays the value left-aligned within the defined width.