Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Currency Conversion Form with Dividing

jessicar2591187
Level 1
Level 1

I have been searching all over and I cannot figure this out.  I am creating and almost done with a form that will calculate the currency conversion rate for Foreign Lodging Receipts.  Basically I need to be able to show how much the lodging is per night in U.S. Dollars.  We use the Total Foreign Currency on the receipt / Total U.S. Dollars charged on the credit card statement.  There are some times, when we need to round a nightly rate up or down by a cent in order to equal the Total U.S. Dollars charged on the statement.

For example, $270.11 was charged on the credit card.  The individual stayed only 2 nights.  $270.11 / 2 = $135.055 per night.  However, I need my Livecycle Table Calculation comes to $135.06 per night and shows the Total Lodging as $270.11.  But I need it to round one night to $135.05.  Otherwise, the credit card will be overpaid by 1 cent.

I can send or upload the form, however I do not see where i can upload.

Jessica

3 Replies
_Bruce_Robertson
Level 10
Level 10

Hi Jessica,

(270.11 / 2).toFixed(2) Will give you "135.06" as a string.  If you need it as a number try +(270.11 / 2).toFixed(2) ... with a plus in front or Number((270.11 / 2).toFixed(2))

or

Math.round((270.11 / 2) * 100) / 100 will also do it and faster but to my eye looks clumsy.

Regards

Bruce

jessicar2591187
Level 1
Level 1

That didn't work for me.  The numbers were example numbers where I run into this problem.  Do you know how I could upload my form to show you?

Jessica

_Bruce_Robertson
Level 10
Level 10

‌Hi Jessica, You have to upload the file to any file sharing site, Google docs, Dropbox, etc. Then you can post a link here.  You should be able to replace the numbers with references to your fields.  Bruce