SitesMasstec
Programmer
Hello colleagues!
In a program I have this code, in order for the user to define how many decimals he/she wants in a number, which saves "Quantity":
(Some users want quantity with no decimal places, other users, which work with kilograms want 3 decimal places in number for quantities).
I have a report with a field which shows "Quantity". In the 'Field Properties', Format, 'Format expression' I put
but it doesn't work.
The other solution is to create 4 fields in the report, in the same position, with conditional printing depending on the value of the variable QtCasasDec. Is there other simpler solution?
Thank you,
SitesMasstec
In a program I have this code, in order for the user to define how many decimals he/she wants in a number, which saves "Quantity":
(Some users want quantity with no decimal places, other users, which work with kilograms want 3 decimal places in number for quantities).
Code:
IF QtCasasDec=0
PICNUMERO="'999999'" && No decimal
ENDIF
IF QtCasasDec=1
PICNUMERO="'999999.9'" && One decimal place
ENDIF
IF QtCasasDec=2
PICNUMERO="'999999.99'" && Two decimal places
ENDIF
IF QtCasasDec=3
PICNUMERO="'999999.999'" && Three decimal places
ENDIF
I have a report with a field which shows "Quantity". In the 'Field Properties', Format, 'Format expression' I put
Code:
"&PICNUMERO"
The other solution is to create 4 fields in the report, in the same position, with conditional printing depending on the value of the variable QtCasasDec. Is there other simpler solution?
Thank you,
SitesMasstec