17
Views
2
Comments
[Formula] FormulaEvaluateDecimal only returns decimal if one of the values is decimal
Question
formula
Service icon
Forge asset by Caio Santana Magalhães
Application Type
Service

Hey Caio,

First of all, great component you developed here!!

While using the "FormulaEvaluateDecimal", I found that if you send 5/2, it returns 2, but if I send 5/2.0 it returns the correct decimal 2.5.

Do you have a quick fix for this issue other than forcing a ".0" at the end of the equation?

This isn't much of a fix since it has 1000 ways it can fail šŸ˜…

Thank you for your time

2024-05-14 05-39-17
Jothikarthika - EONE

In Result expressing you can use inbuild format decimal function

FormatDecimal(265,2,".",",")

265-value

2-decimal digits

.- decimal separator

,-group separtor

please refer the documentation to get more information

https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/built_in_functions/format/

UserImage.jpg
Henrique Bras

Thank you for you answer @Jothikarthika - EONE , but the issue is on the output of the FormulaEvaluateDecimal action, so even if I use the FormatDecimal , it will display "2.00", instead of the 2.5 I'm looking for.

I found a workaround for the issue by doing this replacement beforehand, however, I don't like it at all, in Portugal we call this "Hammering the code to your will", which is never a good solution.

Thanks again

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.