Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

DynaPDF.SetNumberFormat

Limits textfield to only accept numbers.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 6.4 Yes Yes Yes Yes Yes

MBS( "DynaPDF.SetNumberFormat"; PDF; Field; Sep; DecPlaces; NegStyle { ; CurrStr; Prepend } )

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
Field The field index or field name. "FirstName"
Sep The decimal separator.
Can be CommaDot, NoneDot, DotComma or NoneComma.
"CommaDot"
DecPlaces Number of decimal places 2
NegStyle Negative number format.
Can be MinusBlack, Red, ParensBlack or ParensRed.
"ParensRed"
CurrStr Optional
The currency string.
Or empty for no currency.
"€"
Prepend Optional
Position of Currency string.
Pass 1 to prepend or 0 to append.
0

Result

Returns OK or error.

Description

Limits textfield to only accept numbers.
The function restricts the allowed input characters of a text field to numbers and formats the resulting string as specified. A number format is represented as two separate JavaScript Actions in PDF which are automatically created and added to the text field by this function.
The same formats can also be applied manually by creating two JavaScript actions: one for the OnKeyStroke event, and one for the OnFormat event of the text field. See DynaPDF.AddActionToObj() for a description of the events.
DynaPDF uses the JavaScript functions AFDate_Keystroke() / AFDate_KeystrokeEx() or AFDate_Format() / AFDate_FormatEx() to apply a number or date format. The functions are described in the JavaScript scripting reference which is available at http://www.adobe.com.

See also SetNumberFormat function in DynaPDF manual.

Examples

Create field for numbers:

Set Variable [$f; Value:MBS("DynaPDF.CreateTextField"; $pdf; Create Form::Name; -1; Create Form::Multiline; Create Form::MaxLen; Create Form::PosX; Create Form::PosY; Create Form::Width; Create Form::Height)]
Set Variable [$r; Value:MBS("DynaPDF.SetTextFieldValue"; $pdf; $f; Create Form::Value; Create Form::DefaultValue)]
Set Variable [$r; Value:MBS("DynaPDF.SetNumberFormat"; $pdf; $f; "CommaDot"; 2; "Red"; "€"; 0)]

See also

Example Databases


DynaPDF.SetMiterLimit   -   DynaPDF.SetOpacity

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins