URGENT! Need help with a calculation problem

Hello Fellow bubblers :slight_smile:

I have a huge problem and im stuck after 10 hours of failing.

Im doing a loan comparisson site and i need it to calculate the following:

  1. There is a Slider A(amount) and a Slider B(months).
  2. There is a 3 field where i want to show the result of the calculation.
  3. The formula i want to display in the result field is:
    Monthly installment = (Slider a´s value * Monthly interest rate) / (1 - ((1 + Monthly interest rate)^(-Slider B´s value)))

How do i do this??

i realy need you help guys :woozy_face:

Anybody can help?

What’s the problem?

He there - i can tet the calculation to work. How would you do this?

You mean you’re getting the wrong result?

yes i dont know how to get the calculation to work - do i use database og expression or sth 3? Im new to Bubble guys :slight_smile:

the only thing i can get to work is dynamic data with SliderA´s value / SliderB´s value. I cant get the other parts of the formula in there.

Anybody?

Since your expression clearly relies on certain expressions being executed first, I would suggest plugin toolbox or math.js. You can add the entire expression there.

Hope this helps.

This is possibly the first legitimate use-case I’ve seen of Bubble’s Loan Payment formula …

image

image

1 Like

yes i tried to use expression but was not able.

How would you use the expression feature with the above formula?

Did you try Mishavs solution?

Played around a bit and noticed that when using the number 1 in the expression not all of the calculation options were displayed. So instead I used a custom state with value 1.

Steps:

  1. Add the 2 sliders, an input field for the interest rate and an input or a text field to display the result of the calculation.

  2. Create a state on page level, type num, value 1

  1. Add the formula to the element (input / text etc.):

Hope this helps,

Gerbert
MVP Design

1 Like

@gerbertdelangen gave a good solution.

Below, I have used the plugin: Toolbox, element: Expression.

image

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.