This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
dictionary:more:formatnumber [2023/01/09 13:39] James Sentman [format number] |
dictionary:more:formatnumber [2023/01/09 13:45] James Sentman [Examples:] added temperature eample and applescript usage note |
||
---|---|---|---|
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> |