A canning factory I program for has always had production quantities as integer (eg 240 cans of a certain product). That is how the program was developed. Now they are selling powdered product as kg to 3dp. So the production or sale quantity may be 48.375 kg. The program works fine, but ity is all in the cosmetics. They do not want to see 240.000 for cans. Forms and Reports are easy to adjust, but I would like to be able to dynamically set the picture in a table without Setting Queue Item to a local vriable.
A different approach which might be an option which I used, is to have an additional string field in the table which holds the description and then the description can be displayed on windows and in reports easily.
The reason I did this was when a product was being sold by a unit, if it was just 1 unit, the unit displayed without a plural, if more than one unit, it displayed the unit as a plural.
The string field also meant I had less coding to do if the customer wanted to introduce additional units in the future. Lazy Programmers Club Pro Tip!
You can left the column without picture (or use @s10) and it would show the number unformatted, if it is integer it shows the number without decimal sign and fraction part, if it has fraction part, it shows a dot as decimal separator and minimal fraction part without zeros to the right.
Then you can choose Decimal alignment, but the problem is that it doesn’t align properly the only integer numbers seems to start exactly at the dot position, as can be seen on the image:
The other option can be to use conditional listbox styles, with the condition: Qty = INT(Qty) Then use picture @n10~.~ Else default picture @n10.3, then Decimal alignment works fine, but a dot is shown on integer values, see the second image:
You can tie it up with Clarion’s Evaluate() and have a unit table control and format the descriptions and calculations back to a common denominator for that product line. The common denominator or “base unit” is the stock holding figure for accountancy purposes. All other units are derived from or to the base unit.