PRB: Data Is Not Correct, or Is Not as Precise as Expected, When You Use Numeric Functoids in BizTalk Mapper (821421)



The information in this article applies to:

  • Microsoft BizTalk Server 2002

SYMPTOMS

When you use some BizTalk Mapper numeric functoids to calculate noninteger values, your results may not be correct or they may not be as precise as expected. For example, if you multiply 20815.2000 by 1.00, you may receive 208152000 for the result instead of 20815.2.

CAUSE

This behavior may occur if the Default System Locale on your computer running BizTalk Server (or on the computer of a user who logs on) is set to a Regional Locale that uses a different decimal separator character from the one that the data uses in the document that you are processing.

WORKAROUND

To work around this behavior, do one of the following:
  • Change the Default System Locale to a Regional Locale that uses the same decimal separator character as your data. Also, verify that every user who logs on locally to the system uses a Regional Locale that uses the same character for the decimal separator in the Numbers format setting and in the Currency format setting.

    -or-
  • Insert a Microsoft Visual Basic Scripting Edition (VBScript) functoid in your BizTalk Mapper to change the locale for calculations that are performed in the map. The following sample code temporarily changes the system locale to US English:
    SetLocale("us-en")
    
    Function MyFunction0(  )
      MyFunction0 = ""
    End Function
    
    This functoid uses a call to the VBScript SetLocale function, and then passes in the required Locale ID value. This action forces the correct locale setting for the duration of the BizTalk Mapper execution.

STATUS

This behavior is by design.

MORE INFORMATION

When an interactive user logs on, the settings on the user's computer can affect the Locale ID value, and the Locale ID affects how date, time, and currency values are formatted. Microsoft recommends that you explicitly set the Locale ID value by using a BizTalk Mapper functoid. For more information, see the "Resolution" section.

Modification Type:MajorLast Reviewed:8/13/2003
Keywords:kbprb KB821421 kbAudDeveloper