Result of a "double" division gives an integer with no decimal as result | Community
Skip to main content
salvdangelo
Level 5
October 9, 2017
Solved

Result of a "double" division gives an integer with no decimal as result

  • October 9, 2017
  • 3 replies
  • 1950 views

Hi,

Hopefully a simple issue:


Making the division (or using a percent function) A = B/C such as A,B,C are "double" typed for some reason the result is rounded to the next integer.

Iif(B=0, 0, (A*100)/B)

or

Iif(B=0, 0, Percent(A,B)*100 )

Example:
B = 2
C = 3
Result A= 67.00
Expected A= 66.66

Any idea ?

Adobe Campaign

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by salvdangelo

Hi Florent,

I solved this issue using "Percent" but still I cannot understand why the division of two doubles give as a result an integer number without decimal part.

Salvatore

3 replies

florentlb
Level 10
October 30, 2017

Hi,

Can you try using the Round function in your calculation? Round(<number>, <number of decimals>)

Let me know if that would work for you,

Florent

florentlb
Level 10
November 13, 2017

Hi Salvatore,

Were you able to get the result you wanted?

Let me know,

Florent

salvdangelo
salvdangeloAuthorAccepted solution
Level 5
November 13, 2017

Hi Florent,

I solved this issue using "Percent" but still I cannot understand why the division of two doubles give as a result an integer number without decimal part.

Salvatore