Text Formatting
Custom Formatting
Data that is displayed on an invoice in PennyPerfect can have a custom format specified in the template, as part of the caption. The caption of a label is written as {data|format} e.g. {Start Date|ddd dd mmm yyyy}.
The format is optional i.e {Start Date} is OK. If no format is specified or its left blank then a default format is used.
Multiple different formats can be specified within a single caption e.g.
'{Start Date|ddd dd mmm yyyy} {Start Time|h:nnAMPM} to {End Time|h:nnAMPM}'
Date Formatting
The easiest way to explain is with these examples, all of which demonstrate how the date 'Sunday 12 August 2007' would display with various formats.
| Format | Display |
|---|---|
| dd/mm/yyyy | 12/08/2007 |
| d m yy | 12 8 07 |
| dd-mmm-yyyy | 12-Aug-2007 |
| ddd dd mmm yy | Sun 12 Aug 07 |
| dddd dd mmmm yyyy | Sunday 12 August 2007 |
Time Formatting
These formats demonstrate how various times are displayed in specific formats.
| Time | Format | Display |
|---|---|---|
| 4:17am | h:nn | 4:17 |
| 4:17am | hh:nn | 04:17 |
| 4:17am | hhnn | 0417 |
| 4:17am | h:nnAMPM | 4:17am |
| 2:30pm | h:nn | 14:30 |
| 2:30pm | h:nnAMPM | 2:30pm |
| 2:30pm | hh:nn | 14:30 |
Number Formatting
These formats demonstrate how various numbers are displayed in specific formats.
| Number | Format | Display |
|---|---|---|
| 12.47 | 0.00 | 12.47 |
| 12.47 | 0.0 | 12.5 |
| 12.47 | #,##0.00 | 12.47 |
| 12345.67 | #,##0.00 | 12,345.67 |
| 12345.67 | £#,##0.00 | £12,345.67 |
Special Formatting
There are two special formats that can be used for numbers, which are '[Money as words]', and '[Number as words]'. These display the entered number as written words rather than digits. [Money as words] inserts pounds and pence into the phrase at the appropriate point.
| Number | Format | Display |
|---|---|---|
| 12.47 | [Number as words] | twelve |
| 123.47 | [Money as words] | one hundred and twenty three pounds forty seven pence |
Text Case
The property Text Case affects how a label is displayed. It is a property of the whole label and not one piece of data i.e. {Start Date|Upper Case} is not allowed.
The available cases are;
| Text Case | Result |
|---|---|
| no change | This is the default value. The text is displayed as it has been entered into PennyPerfect. |
| UPPER CASE | The text is displayed in upper case e.g. PLEASE PAY WITHIN 10 WORKING DAYS. |
| lower case | The text is displayed in lower case e.g. please pay within 10 working days. |
| Initial Capitals | The text is displayed with the first letter of each word in upper case e.g. Please Pay Within 10 Working Days. |
