Excepting product function to return 4 digits after decimal

Hi All,

Multiplying the below values by product function and expecting to return output as 16956.0843 but it is returning the output as 16956.08. 

product(16746.75 * 1.0125)

Regards,
Sandeep

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    product(16746.75 * 1.0125)

    this is already incorrect.  you don't put the multiplication inside the product() function; you should be using either the multiplication operator "*" or the product() function on the same numbers.

    One thing that's difficult to understand about Appian is that it auto-formats outputs to a user-facing plaintext value no matter what the actual result of the operation is (which is something some of us have a lot of qualms about, but that's another story).  Similar to any displayed result being automatically wrapped in round(X, 2) or similar.  In your case I suspect it's a matter of forcing the output to display the full decimal value, like with the function fixed()...

    fixed(
      product(16746.75, 1.0125),
      4
    )

  • Thank you Mike, actually i missed to correct the product function like product(16746.75, 1.0125)

    fixed() function is giving the output in text type and even though when we are converting to decimal by putting todecimal() function in that case also the output is getting with 2 digits after decimal.

  • 0
    Certified Lead Developer
    in reply to Sandeep

    so i think you misunderstand what i'm saying above...

    The original decimal-type output that's output by the rule *actually does contain* the data you're wanting to see, it's simply being truncated by Appian's front-end while displaying it.  Using "fixed()" simply force-casts it to readable text which forces more of the places to show.  But there's no reason to cast it to text with fixed() then try to cast it back to decimal again, because you're just going back and forth for no reason.

    You can actually see the full value output of just the product() operation by viewing the output as "Expression":

    If you can share a bit more about your use case and what you're trying to ultimately use the value for, that might help us make more sense of how/when to use the appropriate formatting.

Reply
  • 0
    Certified Lead Developer
    in reply to Sandeep

    so i think you misunderstand what i'm saying above...

    The original decimal-type output that's output by the rule *actually does contain* the data you're wanting to see, it's simply being truncated by Appian's front-end while displaying it.  Using "fixed()" simply force-casts it to readable text which forces more of the places to show.  But there's no reason to cast it to text with fixed() then try to cast it back to decimal again, because you're just going back and forth for no reason.

    You can actually see the full value output of just the product() operation by viewing the output as "Expression":

    If you can share a bit more about your use case and what you're trying to ultimately use the value for, that might help us make more sense of how/when to use the appropriate formatting.

Children