Skip to main content
Solved

Using the Number Package with Math Operations and Decimals


Forum|alt.badge.img+8
  • Flight Specialist | Tier 4
  • 63 replies

I’ve been doing some testing using the number package and math operations. According to the documentation, the number package “ holds values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, and up to 15 decimal digits.” Emphasis mine.

I’ve been trying unsuccessfully to add, subtract, multiply and divide where the result should be a decimal. All I’m getting is whole numbers no matter what I feed in. Examples attached.

How do you get the number package to recognize and return decimals?

 

Best answer by Raul Jaimes

@JMarino

 

yes, you need add the action to convert to String to show as a message: 

 

 

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/number-to-string.html

 

Regards

View original
Did this topic help answer your question?

2 replies

Forum|alt.badge.img+8
  • Author
  • Flight Specialist | Tier 4
  • 63 replies
  • July 10, 2024

Ok so after further investigation it seems that the function $variableName.number:ToString” does not return decimal places. This function only returns digits left of the decimal place.

In order to see a resulting decimal from a math operation you have to use the Number Action “Number: To String” which has a configuration for how many decimal places to include. So, if you are outputting any number that contains a decimal to a log, or file, or spreadsheet etc. you will need to first assign that to a string variable using this action.


Raul Jaimes
Forum|alt.badge.img+9
  • Navigator | Tier 3
  • 494 replies
  • Answer
  • July 11, 2024

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings