6 Replies Latest reply: Apr 7, 2015 6:55 AM by Fabian Lepie RSS

    Need to format amount in smallest unit

    Fabian Lepie

      Hi,

      i need an elegant way to format an amount in smallest unit in script to store these data in an csv file.

       

      I have a qvd with fields amount "237,99" and currency "EUR". I must Export these data to an csv file with amount in smalles unit.

      It is difficult to Format amounts for Currencies like YPN because these currency have no decimals. 

      At the moment i used following script:

      Num(Replace( Num(Amount, '0,00'),',','')) as Amount_Num,

      But there is no Differentiation between Currency EUR and Currency YPN.

      I dont think that if - clause is a solution because i assume Performance-disturbing.


      Did anybody know how i can solve these Problem?


       

       

       

       

      Input QVD:

      AmountCurrency
      237,99EUR
      10200,00YPN

       

      Output CSV:

      Amount_NumCurrency
      23799EUR
      10200

      YPN

       

       

      Many thanks for your help!

       

      Regards

      Onkellepie