About    Download    Order    Support


InnPlanner Reservation Software Videos

About
Download
Order/Prices
Support/Contact
Partner Program
Press Room
Online Help


Recent News

InnPlanner 2010 Released
New faster database engine, more customization features, weekly tariffs, full multi-user work support and much more...

2010 Feb 10

InnPlanner 2010 RC1
InnPlanner 2010 Release Candidate 1 is ready for downloading and testing. You can download it from the "Downloads" section.

2010 Jan 14


Hotel Software Documentation

Formatting Data

Formatting Data

Formatting can be carried out either using formatting strings or via a special dialog window. 

When formatting by means of a string, the first four characters define the type of formatting, and the rest of the characters - the formatting details. For example:

  • date Y.m.d.
  • math ###'###0.00
  • bool yes/no.

When printing values from variables, the formatting line follows the ^ sign; for example:

  • [$order_date^date Y-m-d]
  • [$total^math ###'###0.00]
  • [$vip^bool yes/no]

Index

  1. Mathematical Format (math)
  2. Date Format (date)
  3. Time Format (time)
  4. Boolean Format (bool)
  5. Text Format (text)
  6. Recordset Format (rset)

Mathematical Format

Is used for formatting digits.

Format string example: math ###-#0,00

  • "-" - means a symbol used to separate groups;
  • "," - means a symbol used to separate decimal part;
  • Number of "#" means the number of digits in a group;
  • Number of "0" means the number of digits after decimal. You can use "*" to view all digits after decimal.
  • If you specify |NO_ZERO| in the format text box, and the output value is a zero, no value will be shown.

Examples:

Test StringFormat StringResult
1234567,89math ###'#0.001'234'567.89
1234567,89math ### #0.01 234 567.9
1234567,89math $###,#0$1,234,568
1234567,89math #0,00EUR$1234567,89EUR
0math #0|NO_ZERO|

Date Format

Is used for formatting dates.

Format string example: date dd-mm-yy

  • m - Numeric representation of a month, without leading zeros (1, 2, 12);
  • mm - Numeric representation of a month, with leading zeros (01, 02, 12);
  • mmm - a short textual representation of a month, three letters (Jan, Feb, Dec);
  • mmmm - a long textual representation of a month (January, February, December);
  • d - Day of the month without leading zeros (1, 2, 24);
  • dd - Day of the month with leading zeros (01, 02, 24);
  • ddd - A textual representation of a day, three letters (Mon, Tue, Sun);
  • dddd - A textual representation of a day (Monday, Tuesday, Sunday);
  • yy - year, 2 letters (99, 00, 04);
  • yyyy - year, 4 letters (1999, 2000, 2004).

Examples:

Test StringFormat StringResult
16 April 2005date yyyy-mm-dd2005-04-16
16 April 2005date dd mmmm 'yy16 April '05
16 April 2005date dd mmm yyyy (dddd)16 Apr 2005 (Sunday)

Time Format

Is used for formatting time.

Format string example: time hh:mm:ss AMPM

  • h - hour without leading zeros (2, 11);
  • hh - hour with leading zeros (02, 11);
  • m - minute without leading zeros (2, 59);
  • mm - minute with leading zeros (02, 59);
  • s - second without leading zeros (2, 55);
  • ss - second with leading zeros;(02, 55)
  • Use the "AMPM" string to show time in the AmPm format.

Examples:

Test StringFormat StringResult
18:30:45time hh:mm:ss18:30:45
18:30:45time hh:mm:ss AMPM06:30:45 PM
18:30:45time h:mm:ss AMPM6:30:45 PM

Boolean Format

Is used for formatting Boolean values (the values that can only be true or false). False means an empty string or 0, true means any string or number other than zero.

Format string example: bool TrueText/FalseText

  • TrueText will be printed if the value is true
  • FalseText will be printed if the value is false.

Examples:

Test StringFormat StringResult
"1"bool Yes/No"Yes"
"0"bool Yes/No"No"
"230"bool Yes/No"Yes"
""bool Yes/No"No"
"false"bool Yes/""
"Hello World"bool Text"Text"
""bool Text""

Text Format

Can be used for formatting any values.

Format string example: text Flags

Flags - flags separated by ";"

  • UCASE - convert text to upper case
  • LCASE - convert text to lower case
  • LEFT(N) - show only first N symbols (e.g. LEFT3)
  • RIGHT(N) - show only last N symbols (e.g. RIGHT5)
  • TRIM - delete leading spaces from the text.
  • SYMB(N) - show the N symbol of the text.
  • WORD(N) - show the N word of the text.
  • LINE(N) - show the N line of the text.
  • NOTAGS - remove html tags from the text (<a>,</b>, etc).
  • FROMstr - returns text beginning with the first entry of the str string.
  • UPTOstr - returns text before the first entry of the str string.
  • REPMfind->replace - Replaces all find entries in the string with replace.
  • REPOfind->replace - Replaces the first find entry in the string with replace.
  • CODE(N) - Encrypts string with the XOR method. N - encryption offset.

When you use SYMB, WORD and LINE, a zero N value stands for the first character, first word and line respectively.

Flags are applied to the line in the order of their appearance in the format text box. Thus, if you want to get the first 3 characters of the second word, you should use the "WORD1;LEFT3" combination.

Examples:

Test StringFormat StringResult
Hello World!!!text UCASEHELLO WORLD!!!
Hello World!!!text LCASEhello world!!!
Hello World!!!text LEFT5Hello
Hello World!!!text RIGHT4d!!!
Hello World!!!text LEFT5;UCASEHELLO
Hello World!!!text LEFT-5;Hello wor
Hello World!!!text WORD0Hello
Hello World!!!text WORD1;LEFT3Wor
Hello World!!!text WORD1;SYMB2;UCASER
First line
Second Line
text LINE1;Second Line
Hello World!!!text FROMWorld!!!
Hello World!!!text UPTO!Hello World
Hello World!!!text REPMl->xHexxo Worxd!!!
Hello World!!!text REPOl->xHexlo World!!!
Hello World!!!text CODE7Obkkh'Phukc&

Recordset Format

This format is used for printing records contained in a variable of the recordset type as text. Such variable can be created, for instance, with a query or, for instance, in a many-to-many relational field. This format appears as a list of fields, data from which is to be displayed. Suppose, we have a variable [$recs] that contains 3 records with the following field values:

DateTitleQuantityTotal
Record 1:2006-07-14Apple515
Record 2:2006-07-16Tomato1020
Record 2:2006-07-19Juice416

Let's show how they will appear with different rset formattings:

Test Text FormulaResult
[$recs^rset |Title|, ]Juice, Tomato, Apple
[$recs^rset |Title| - $|Total|; ]Juice - $16; Tomato - $20; Apple - $15
[$recs^rset |Date|: |Title| - $|Total|[br]]
([br] - means line BReak)
2006-07-14: Juice - $16
2006-07-14: Tomato - $20
2006-07-14: Apple - $15
[$recs^rset |Title|, Quantity=|Quantity|;[br]] Juice, Quantity=4;
Tomato, Quantity=10;
Apple, Quantity=5
[$recs^rset "|Title|", "|Quantity|"[br]]" "Juice", "4"
"Tomato", "10"
"Apple", "5"

Please note that in the last example there is an additional quote before the tag closure. That is necessary since the delimiter (in this case that's the "[br]) is not to be placed.

Thus, the rset format is the foundation for outputting record set values.

For performing operations over records in a recordset variable, use the cycle For Each Record From Recordset.

See Also:

Report Style Editor

Text Formulas

Custom Export




Today"s Poll

What software do use for your inn/b&b/hotel/etc?

Do not use
Inn Planner
Access, Excel
ASSD
Auberge
Digitalrez
Easy Inn Keeping
EnSuite HR
GuestMaster
iMagic HR
Smart FX
Other