Richard
Richard

Reputation: 1038

smarty string_format doesn't round up

Based on the documentation of string_format

This:

{$testy = 16.99}{$testy|string_format:'%d'}

Should output 17 but it gives me 16 instead

Anyone knows how to fix it?

Upvotes: 1

Views: 234

Answers (1)

Alberto Moro
Alberto Moro

Reputation: 1013

I think there is an error in the new documentation. If you look at the old version it is correct.

In cases you need 17 I recommend this:

{$testy|ceil|string_format:"%d"}

Upvotes: 1

Related Questions