GetAndMoveDecimalPosition

Get and Move Decimal Position

Minor Business Rule

Object Name: B0700048

Parent DLL: CPAY

Location: Client/Server

Language: C

Functional Description

Purpose

This Business Function (B0700048) is used to move the decimal of a given amount to the  left or 

right, depending on the Data Dictionary Items that are place in the FROM and TO Data Item parameters. 


Setup Notes and Prerequisites

Parameters to be sent into and out of this Function:

     Move Decimal From Data Item ->  (Example - WCRG)

     Move Decimal To Data Item ->  (Example - GENR)

     Amount <->  (Example - mnAmount)


Special Logic




Technical Specification

Go out to the Data Dictionary and get the Display Decimal Positions for the From and To Data Item 

sent into this Function.


Take the From Data Item Display Decimals and subtract the To Data Item Display Decimals to find the 

difference in between the two.


If the Difference is greater than 1

  Do the following the number of times equal to the Difference:

    mnAmount = mnAmount * 10

  End Do

Else

  If the Difference is less than 1

    Difference = Difference * -1

    Do the following the number of times equal to the Difference:

      mnAmount = mnAmount * .1

    End Do

  End If

End If


Example:

mnAmount = .00122 

Display Decimals for WCRG = 5 (From Data Item)

Display Decimals for GENR = 3 (To Data Item)

Difference between the FROM and TO Display Decimals: 5-3=2


Move the decimal Position to the Right two positions.

  .00122 * 10 = .0122

  .01220 * 10 = .1200

  mnAmount = .12200


Data Structure

D0700048 - Get and Move Decimal Position

Parameter NameData ItemData TypeReq/OptI/O/Both
szMoveDecimalFromDataItemDTAIcharOPTINPUT

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

szMoveDecimalToDataItemDTAIcharOPTINPUT

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

mnAmountMN29D9MATH_NUMERICOPTBOTH

This is a generic field used as a work field in Everest.

cErrorFlagEV01charOPTNONE

An option that specifies the type of processing for an event.

Related Functions

None

Related Tables

None