I want to round down the decimal places.

Kurumi
Tera Contributor

I created a business rule that sums the values in the related list and populates a column in the base record when a record is inserted or updated.
The business rule worked properly and the total amount was set in the column.
However, I wanted to display the total amount by rounding down the decimal places, but it cannot be rounded down.
Please tell me how to round down the decimal places.

This is the business rule I created.

Kurumi_1-1703556158589.png

When outputting to the log, decimal places are not displayed.

Kurumi_2-1703556229556.png

 

This is the value set in the record.
The column you want to set is of String type.

Kurumi_3-1703556298124.png

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@Kurumi Please replace line number 11 in your business rule as follows.

current.other_stock_total=total.toString().split('.')[0];

Hope this helps.

View solution in original post

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@Kurumi Please replace line number 11 in your business rule as follows.

current.other_stock_total=total.toString().split('.')[0];

Hope this helps.

Kurumi
Tera Contributor

@Sandeep Rajput 
thank you for your reply.
Thanks to you I solved it.