1b.app
Link copied -

sometimes the order amount from the variable pulls with thousandths in the format 123.0000 instead of 123

- it was noticed that sometimes the order amount from the variable pulls with thousandths in the format 123.0000 instead of 123 , this leads to sending 2 sms instead of 1 and often customers do not correctly understand the amount.
Original question is available on version: ru

Answers:

Ярина
Personal license
You can specify the number of digits after komi in square arms in the middle of the change, for example {|$ordersum[#0]|} - means that the number of the "sum of the process" will be rounded to tsіlih
09.09.2021, 13:01
Original comment available on version: ru


Yarina
integrator wrote:
You can specify the number of digits after komi in square arms in the middle of the change, for example {|$ordersum[#0]|} - means that the number of the "sum of the process" will be rounded to tsіlih

Dyakuyu! I'm just wondering why in 90% of cases the system generates a round sum, and in 10% it prescribes a comma and zeros. didn't see the pattern.
09.09.2021, 14:46
Original comment available on version: ru

and another problem is that {|$ordersum[#0]|} is formed only in the data array, and separately the [ordersum] variable behaves differently for some reason
09.09.2021, 17:26
Original comment available on version: ru

Ярина
Personal license

Zubarev Sergey
Optium
Client wrote:
Dyakuyu! I'm just wondering why in 90% of cases the system generates a round sum, and in 10% it prescribes a comma and zeros. didn't see the pattern.

here, perhaps, the programmers can give advice.

Zubarev Sergey
Optium
Client wrote:
and another problem is that {|$ordersum[#0]|} is formed only in the data array, and separately the [ordersum] variable behaves differently for some reason

because of the different types of change. the curly temples are exactly right.
10.09.2021, 10:35
Original comment available on version: ru

Sergey, did Yarina's solution solve your problem?
If yes, you can mark the correct answer.
10.09.2021, 17:09
Original comment available on version: ru

no output of {|$ordersum[#0]|} variable in sms caused process to crash - this variable does not work in sms , reverted to [ordersum]. but it is still not clear why in the same stages of the process the variable is formed differently.
10.09.2021, 19:57
Original comment available on version: ru


no output of {|$ordersum[#0]|} variable in sms caused process to crash - this variable does not work in sms , reverted to [ordersum]. but it is still not clear why in the same stages of the process the variable is formed differently.

in Smarty, you can use the number_format modifier, which sets the format for displaying the date
you can try the variable {|$ordersum|number_format:0|} (this is if rounded to integers), or {|$ordersum|number_format:2:".":","|} (2 decimal places, decimal separated by a dot, and thousands - a comma)
13.09.2021, 16:26
Original comment available on version: ru



Tyndyk Maxim Vadimovich
OneBox production
Administrator wrote:

no output of {|$ordersum[#0]|} variable in sms caused process to crash - this variable does not work in sms , reverted to [ordersum]. but it is still not clear why in the same stages of the process the variable is formed differently.

in Smarty, you can use the number_format modifier, which sets the format for displaying the date
you can try the variable {|$ordersum|number_format:0|} (this is if rounded to integers), or {|$ordersum|number_format:2:".":","|} (2 decimal places, decimal separated by a dot, and thousands - a comma)

your solution is working, thanks.
17.09.2021, 10:33
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment