Skip to content

DF_DECIMAL_SEPARATOR

See Also

The decimal ASCII value of the radix (character to use to separate the integer portion of a number from the decimal portion).

Level

Global

Supported by

All Drivers

Type

Numeric, temporary

Access

Read / Write

Values

0 - 255

Driver Configuration Keyword

None

Remarks

DF_DECIMAL_SEPARATOR allows the character used to separate the integer and decimal parts of a number (the radix) to be set.

By default, the DF_DECIMAL_SEPARATOR will conform to the regional settings on the machine. Windows visual controls also use the regional settings. If the DF_DECIMAL_SEPARATOR does not conform to the regional settings, errors will occur when using certain Windows controls. For this reason, you should only set this attribute on a temporary basis or in programs that have no user interface.

Temporarily changing the number format is often used to output numbers in a required format. Some applications need to output information for additional processing by other, possibly third-party, applications. If the additional processing requires numbers in a certain format, the DataFlex application should change the current number format to the required one, output the data, and reset the current number format to its original value.

Example Procedures

ShowFormats

Procedure ShowFormats
    Integer iDateFormat
    String sDateFormat
    Integer iDateSep
    Integer iDecimalSep
    Integer iThousandSep

    Get_Attribute DF_DATE_FORMAT To iDateFormat
    Get_Attribute DF_DATE_SEPARATOR To iDateSep
    Get_Attribute DF_DECIMAL_SEPARATOR To iDecimalSep
    Get_Attribute DF_THOUSANDS_SEPARATOR To iThousandSep

    If (iDateFormat = DF_DATE_USA) Move "USA" To sDateFormat
    Else If (iDateFormat = DF_DATE_EUROPEAN) Move "European" To sDateFormat
    Else If (iDateFormat = DF_DATE_MILITARY) Move "Military" To sDateFormat
    Else Move "Unknown" To sDateFormat

    Send Info_Box ("Formats:\nDate:" * sDateFormat + ;
                    "\nDate separator:" * Character(iDateSep) + ;
                    "\nDecimal separator:" * Character(iDecimalSep) + ;
                    "\nThousand separator:" * Character(iThousandSep))
End_Procedure // ShowFormats
This example obtains the date and number format in use by DataFlex and then pops up a message box that displays a message showing which format is in use.

OutputOrderTotal

Procedure OutputOrderTotal Integer iChannel String sFilePath
    Integer iOrgDecimalSep

    Get_Attribute DF_DECIMAL_SEPARATOR To iOrgDecimalSep
    Set_Attribute DF_DECIMAL_SEPARATOR To (Ascii('#'))

    Direct_Output Channel iChannel sFilePath
    Clear OrderHea

    Repeat
        Find Gt Orderhea By 1
        If (Found) Writeln Channel iChannel OrderHea.Order_Number,Orderhea.Order_total
    Until (Not(Found))

    Close_Output Channel iChannel
    Set_Attribute DF_DECIMAL_SEPARATOR To iOrgDecimalSep
End_Procedure // OutputOrderTotal
This example temporarily changes the number format in use to output the contents of a table to an ASCII disk file.