Skip to main content
amitk9244
November 7, 2022
Solved

How to round up large Number in appian

  • November 7, 2022
  • 8 replies
  • 0 views

I want to roundup below result to ...upto two places like 3.13....how could i achieve that

please help

Best answer by peter.lewis

There's probably a more efficient way to do this, but here's at least an example that would work. I think you have to get your result into a state where it can easily be rounded, so I used a combination of log() and power():

a!localVariables(
  /* Original Variables */
  local!interest: 10,
  local!months: 12,
  
  /* Original Expression */
  local!base: 1+ local!interest,
  local!power: power(local!base, local!months),
  
  /* New Logic */
  local!numberOfDigits:floor(log(local!power, 10)),
  local!decimalOnly: local!power / power(10, local!numberOfDigits),
  local!rounded: round(local!decimalOnly, 2),
  
  /* Final Result */
  local!rounded * power(10, local!numberOfDigits)
)

8 replies

mohank0008
November 7, 2022

roundup(7.36819e+12,2) gives the result of 7.37

amitk9244
amitk9244Author
November 7, 2022

Not working

November 7, 2022

You are trying to round up 3.138428e+12 (which is equivalent to 3138428000000) to 2 decimal points. How's that can be possible? roundup() will work when you will have a value containing decimal points. For example: roundup(3.1414, 2) gives 3.14

amitk9244
amitk9244Author
November 7, 2022

ok.. got it, but i want lesser value

November 7, 2022

What do you mean by lesser value?

Acc to your code, 11^12 will return 3.138428e+12 only

November 7, 2022

I don’t like to study at all, I went to university only to calm my parents down. And in order not to waste time writing papers, I simply turn to services https://cheap.essaydoc.com/ that write essays for me quickly and efficiently. And I rest and get good grades

csteward
November 7, 2022

Also don't forget the fixed() function, just note it does return a text value of the number:

a!localVariables(
  local!base: 1+ri!interest,
  local!power: power(local!base,ri!months),
  /*local!round: round(local!power,3),*/

  fixed(local!power,2)
)

peter.lewis
Employee
November 7, 2022

There's probably a more efficient way to do this, but here's at least an example that would work. I think you have to get your result into a state where it can easily be rounded, so I used a combination of log() and power():

a!localVariables(
  /* Original Variables */
  local!interest: 10,
  local!months: 12,
  
  /* Original Expression */
  local!base: 1+ local!interest,
  local!power: power(local!base, local!months),
  
  /* New Logic */
  local!numberOfDigits:floor(log(local!power, 10)),
  local!decimalOnly: local!power / power(10, local!numberOfDigits),
  local!rounded: round(local!decimalOnly, 2),
  
  /* Final Result */
  local!rounded * power(10, local!numberOfDigits)
)