How to bring 2 decimal number in the Dec function

rolguin

Member
Hi,

I am having problems to convert two strings, one representing integer and another the decimals.

When I have 10, 20, 30, ...., 60, 70 as decimal - like: 1.10 or 1.30

I am getting 1.1 , 1.2, 1.3 ....etc..

DEC(STRING(stock.curr-stock) + "." + STRING(stock-in,">>9")).

Thank you very much for your help or any ideas on this and Happy New Year.

Regards,
ricardo Olguin
 

Stefan

Well-Known Member
What is not-decimal about 1.1, 1.2 etc?

If you want to display the decimal with precision 2 then you will need to add it to your display part:

Code:
DEF VAR iwhole AS INTEGER INITIAL 1.
DEF VAR idecimal AS INTEGER INITIAL 60.

MESSAGE
   STRING( DECIMAL( SUBSTITUTE( "&2&1&3":U, SESSION:NUMERIC-DECIMAL-POINT, iwhole, idecimal ) ), ">>9.99":U )
VIEW-AS ALERT-BOX.
 
Top