Property "Value Format" <format>

Top  Previous  Next

When the Value Property of a Text or Edit Box element is number, you can specify how the numbers are to be formatted using the value format function.

Examples:

Value

Value Format

Display

1200

#,###

1,200

12

#,###

12

12.25

#,###

12

12.25

#,###.00

12.25

12.25

#,###.000

12.250

-12.25

#,###.000

-12.250

12.25

0,000.000

0,012.250

-12.25

0,000.000

-0,012.250

12.25 TRL

0,000.000 ?

0,012.250 TRL

12.25 USD

? 0,000.000

USD 0,012.250

 

Grouping Separator and the Decimal Separator can be different depending on the language of the page.

Example:

 

Country

Grouping Separator

Decimal Symbol

Value Format

Turkey

.

,

#.###,00

U.S.A

,

.

#,###.00

 

Language dependent system variables

When formatting numbers instead of hard coding these separators you can use special system variables:

%vof(GS) : Grouping Separator 

%vof(DS) : Decimal Separator

 

These system variables take on values relative to the language of the page.

Example:

Value

Value Format

Display

1204.25

#%vof(GS)###%vof(DS)00

1.204,25  (Page in Turkish)

1204.25

#%vof(GS)###%vof(DS)00

1,204.25  (Page in English)

 

Formation numbers using %xfn() function

If you need to format a number anywhere else, for example in a richtext element, you can place the Library element  "System Library > mor > XSLTemplates > MMTemplates" into page and call %xfn() function.

using_fn_xsltemplate

Using a decimal format other than "std"

In case of you need to format a number using a decimal format other than "std", which is defined by the Application Studio automatically, then you should first define it using %decfmt() compile-time function and refer it in the format parameter as follows.

#.###,00//fmt_en

 

The "//" is the seperator between the format and the decimal format name. The fmt_en should be defined using %decfmt() anywhere in the current page as follows

%decfmt('fmt_en',',','.')

 

Another Example:

%decfmt('fmt_fi',' ','.')

%xfn(Price,'# ###.00//fmt_fi')

 

Used In Elements

 

Text

Edit Box