User Tools

Site Tools


dictionary:more:formatnumber

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dictionary:more:formatnumber [2023/01/09 13:39] – [format number] James Sentmandictionary:more:formatnumber [2023/02/13 14:52] (current) – external edit 127.0.0.1
Line 19: Line 19:
 | - | displays the minus sign to the left of the number if the number is negative, makes no change if the number is positive.| | - | displays the minus sign to the left of the number if the number is negative, makes no change if the number is positive.|
 | E or e | displays the number in scientific notation.| | E or e | displays the number in scientific notation.|
-| \character | displays the character that follows the backslash.|+| \character | displays the character that follows the backslash. When using with the verb in applescript you will need to double slash this. See applescript usage note below.|
  
 additionally the string may contain 3 formats separated by semicolons to be used when the number is positive, negative or zero. additionally the string may contain 3 formats separated by semicolons to be used when the number is positive, negative or zero.
Line 28: Line 28:
 |#.0000|1.3|1.3000| |#.0000|1.3|1.3000|
 |0000|5|0005| |0000|5|0005|
 +|#.#\ \°\F|75.621|75.6 °F|
 |#%|0.25|25%| |#%|0.25|25%|
 |###,###.##|145678.5|145,678.5| |###,###.##|145678.5|145,678.5|
Line 36: Line 37:
 |#.##;(#.##);\z\e/r\o|-3.7|(3.7)| |#.##;(#.##);\z\e/r\o|-3.7|(3.7)|
 |#.##;(#.##);\z\e\r\o|0|zero| |#.##;(#.##);\z\e\r\o|0|zero|
 +
 +**AppleScript Usage Note:** the same backslash character is used to escape values in an applescript string, so to use this in AppleScript you need to double backslash the backslash character. For the example above of formatting a temperature value which is “#.#\ \°\F” would work in the various formatting fields but when using in the **format number** verb in AppleScript you would have to enter it like:
 +
 +<code>
 +write log format number 75.621 format “#.#\\ \\°\\F”
 +</code>
dictionary/more/formatnumber.1673271578.txt.gz · Last modified: 2023/02/13 14:51 (external edit)