` Working with 2 or 4 Decimal Places (Ray Goudie ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Working with 2 or 4 Decimal Places
2003-11-18 -- Ray Goudie
 
In your dictionary file defintion, use the four decimal places for all monetary fields, as required by spec. Ensure that every such monetary field has a constant picture, say, "@n14.4". In your config file, have a byte that determines how many decimnal digits a particular customer wants to use. Then, in the Init method of your form windows, just after opening the window, you loop through all the fields and if the fields picture is equal to "@n14.4", you replace the picture with the appropriate picture according to the user's preference: --- currentField = 0 loop currentField = window{PROP:NextField, currentField} if currentField = 0 break end if (currentField{PROP:Type} = CREATE:Entry) and | (currentField{PROP:Text} = '@n14.4') case decimalPlaces of 2 currentField{PROP:Text} = '@n12.2' of 3 currentField{PROP:Text} = '@n13.3' end end end --- I feel that there may be more effective methods, but none come to mind at this time.


Today is November 21, 2024, 7:47 am
This article has been viewed 35218 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: