Forum Discussion

gbreck's avatar
gbreck
New Contributor
9 years ago

.toFixed(2) function behaves differently than Javascript version

I have noticed that the expression language version of the toFixed function rounds up on “5” but the Javascript version in web coding does not. Is this intentional? I did some research and maybe the SnapLogic version is using the Java version: .setScale(2, BigDecimal.ROUND_HALF_UP) for example.

2 Replies

  • acesario's avatar
    acesario
    Contributor II

    This worked perfectly… not sure who to give the solution to… Viktor solved the basic approach problem, j dialed in. thanks to each of you!

  • viktor_n's avatar
    viktor_n
    Contributor II

    My recommendation is to learn as much as you can of them, but I think most of the times are used Arrays, Strings, Objects, Dates.