AnsweredAssumed Answered

Using "Rint" and complex currency calculations £ $ €

Question asked by AndrewJudd on Jul 13, 2015
Latest reply on Jul 14, 2015 by AndrewJudd

Title

Using "Rint" and complex currency calculations £ $ €

Post

Hi all,

I'm trying to use the below calculation for a field in a portal to invoices in my contact layout. Basically one part of the portal lists the invoice totals related to a particular client so a user can quickly see what they have purchased etc. I'm trying to format the format the cell properly as currency with a , and .00 (and can't use standard inspector formatting so am using a calculation field). Hopefully the below makes sense, what I am getting at the moment is empty fields when the currency is $ or €. My last part regarding "non art invoices" is  returning £0.00 when in fact it should be a figure. Perhaps there is something obviously wrong with the below?

thank you!...

 

If (IsEmpty (Change to EURO & Change to US); "£" & Let ( [Rint = Int ( ARTWORK::Invoice Total ) ;
          Rdec = ARTWORK::Invoice Total - Rint
        ] ;
          NumToJText ( Rint ; 1 ; 0 )  & "." & Right ( "0" & Rdec * 100 ; 2 ))

 

& If (not IsEmpty (Change to US); "$" & Let ( [Rint = Int ( ARTWORK::Invoice Total ) ;
          Rdec = ARTWORK::Invoice Total - Rint
        ] ;
          NumToJText ( Rint ; 1 ; 0 )  & "." & Right ( "0" & Rdec * 100 ; 2 ))

 

& If (not IsEmpty (Change to EURO) ; "€" & Let ( [Rint = Int ( ARTWORK::Invoice Total ) ;
          Rdec = ARTWORK::Invoice Total - Rint
        ] ;
          NumToJText ( Rint ; 1 ; 0 )  & "." & Right ( "0" & Rdec * 100 ; 2 ))

 

& Let ( [Rint = Int ( Non Art Invoice TOTAL ) ;
          Rdec = Non Art Invoice TOTAL - Rint
        ] ;
          NumToJText ( Rint ; 1 ; 0 )  & "." & Right ( "0" & Rdec * 100 ; 2 )))))

Outcomes