Help Decimal Precision

HanenHanen Member Posts: 281
Hi,

This is my problem: I have three diffrent amount and I need to convert to text:
1- 66,5 --> I get 0000665 --> Should get 0000066500
2- 66,530 --> I get 0006653 --> Should get 0000066530
3- 66,538 --> I get 0066538 --> Should get 0000066538
:-k
How can I do that I'm using this code:

Amount:=FORMAT(PaymentLine."Credit Amount",0,'<Sign><Integer><Decimals,3><1000Character,.><Comma,.><Precision,3:3>');
AmountVir := DELCHR(Montant,'=',',');
AmountVir := DELCHR(MontantVir,'=',' ');
FinalAmount:=PADSTR('',10-STRLEN(FORMAT(AmountVir)),'0')+FORMAT(AmountVir);
Regards

Hanen TALBI

Comments

  • cyuwonocyuwono Member Posts: 28
    This should work.
    Amount:= DELCHR(FORMAT(PaymentLine."Credit Amount",0,'<Sign><Precision,3:3><Standard Format,0>'),'=',',');
    FinalAmount::= PADSTR('',10-STRLEN(FORMAT(Amount)),'0') + Amount;
    


    Carlos Yuwono
    Carlos Yuwono
Sign In or Register to comment.