1

I have one list called Capital Projects with Orig Budget, Amount Spent, Amount Left. I have another list with invoices with Invoice number and TotalAmount. I wrote a workflow that runs every time an Invoice is entered.

These are the statements: Set Variable: CASAMT2 to Capital Projects #:Amount Spent

Calculate Current Item:TotalAmount plus Variable:CASAMT2(Output to Variable:CalcAmtSpent)

Update item in Capital Projects # (this goes back the Amount Spent Column for the associated record)

It all works well. Only issue is when I Set the Variable CASAMT2, it rounds the Amount Spent number to the nearest dollar. So if the Amount Spent number is 1.56, it rounds it to 2. I would like to know if there is any way around this. I set Amount Spent to be both currency and number and it happens for both cases. Since this is a budget and dealing with currency, I need the 2 digits to be accurate.

Thanks for any help.

1

I'm assuming CASAMT2 is a workflow variable. Make sure it is type 'number'.

When you are setting the variable, what are you selecting for the 'Return Field As' option? You should select 'Double' or 'Currency' if either of those are available.

  • Yes CASAMT2 is a workflow variable and it is type "number". when I create the variable I don't get an option to choose the Return field as, but I can see in the grayed out field that it says "Double". I also tried to use the CapitalProjects:Amount Spent directly in the Do calculation and it kept coming out as 0. That is why I went with the variable. – user23699 Feb 14 '14 at 21:25
  • Is CalcAmtSpent also 'number'? One thing you can do is have a 'log' statement after each step, outputting the variable. You then can look at the workflow history to see these values. Once you are 100% sure which step is producing the issue, it will be easier to debug. – tyshock Feb 14 '14 at 21:32
  • Yes, I have done that. That is how I know it is rounding when I get the Amount Spent value from the Capital Projects list. So for instance, the amount spent is 4602.56 and the Total Amount is 9.33. In the log it says 4603 and 9.33 and so when they are added together it gets 4612.33 instead of 4211.97 – user23699 Feb 14 '14 at 21:40
  • And yes, CalcAmtSpent is a number field. It seems to have to do with coming from the other list. – user23699 Feb 14 '14 at 21:43
  • A little more information: If I log Capital Projects: Amount Spent, it logs correctly at 4602.56. However, when I log the variable it logs 4603. So it is rounding when it is saving to the variable. – user23699 Feb 14 '14 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.