Skip to content
+1-888-319-3663

COMMUNITY FORUM

Error importing journals

Leicester asked 6 years ago
Hi,
I have setup an integration for G/L journal entries reading from a csv file.  The amounts in the file contain decimal places but when I import the file, the amounts are being rounded (I imported to a GP file and saw the output).  I have put this calculation for the debit amounts in the file:
if (_GT_TRNCD = 75)
return fn.DOLLAR(_GT_AMOUNT,2)
else return 0
End If
The GL_TRNCD field determines whether the amount is debit or credit.  When I run the integration, I receive the error “failed to convert the parameter value from a string to a decimal”.  How can I import the amounts with decimal places using a calculation or what change do I need to make to my calculation for the decimal places to be imported?
Thanks
 
Answers
Lorren Zemke answered 6 years ago
Leicester,
Try this instead. This will get that field to a decimal before trying to round it.
 
if (_GT_TRNCD = 75) then
  return decimal.parse(_GT_AMOUNT.ToString()).Round(2)
else
  return 0
end if
 
 
Leicester replied 6 years ago

Hi,

I replaced my formula with yours, but when the map is run, each amount is being set to the number 2, which I think is coming from the round option.

Thanks

Chris Hanson Staff answered 6 years ago
The syntax would actually look like the following, based off Lorren’s answer:
 
if (_GT_TRNCD = 75) then
  return Math.Round(decimal.parse(_GT_AMOUNT.ToString()), 2)
else
  return 0
end if
 
That should call the Round command on the result of converting your source value to a decimal, rounding it to 2 decimals.
 
H
Leicester replied 6 years ago

Thanks, it works now.


If you would like to submit an answer or comment, please sign in to the eOne portal.