Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I have a calculation for a field that is not doing exactly what I expected and I cannot figure out what I am doing wrong. I am trying to calculate the total billed. The following is the calculation I use for the field "TotalBilled":

Case ( ReceivedbyBC = "retainer" ; Deposit ; IsEmpty ( StartTime ) or IsEmpty ( EndTime ); Oldtotalbilled; (Round(

Hour( EndTime - StartTime ) + Minute( EndTime - StartTime ) / 60;

2)

+

If(

GetAsNumber(EndTime) <= GetAsNumber(StartTime);

24;

0)) * HourlyRateBilled +Round ( OverdueInterest ; 2 ))

It first checks to see if the Field "ReceivedbyBC" is set to "retainer", if it is then it uses the Field "Deposit" as the total amount billed.

It then checks to see if the Fields "StartTime" and "EndTime" are empty, if it is then this client is from Old imported data and uses the Field "Oldtotalbilled" as the total amount billed.

If Fields "StartTime" and "EndTime" are valid it then calculates the time duration and multiplies it by the Field "HourlyRateBilled" and adds any overdue interest. this is rounded to 2 decimal places since I want it in the format $1.00.

The Problem is that I get rounding errors. If we assume a Hourlyratebilled of 300. No deposit and No overdue interest and Set the start time to 07:00 and end time to 07:35 I get a total billed of 174.00 instead of 175.00. I can't figure out how to correct this

Please help

Why don't you try something simple like:

Case (

ReceivedbyBC = "retainer" ; Deposit ;

IsEmpty ( StartTime ) or IsEmpty ( EndTime ) ; Oldtotalbilled ;

Let ( [

billTime = EndTime - StartTime + ( EndTime < StartTime ) * 86400 ;

billAmt = billTime * Hourlyratebilled / 3600

] ;

Round ( billAmt + OverdueInterest ; 2 )

)

)

BTW, rounding is one thing, and formatting "as $1.00" is another. If you want currency formatting, with 2 trailing decimal places, use Format > Number... in Layout mode. Rounding is a numerical operation, and 1 rounded to 2 decimal places is still 1.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.