Comparing numbers

From: Date: Tue, 06 Apr 2004 13:53:02 +0000
Subject: Comparing numbers
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11235@lists.php.net to get a copy of this message
Hi there, I have a need to compare two numbers, and if one is greater than the other, output some stuff. In this example, {$Events[i].monthnum} = 03 {$Month} = 04 {if $Events[i].monthnum > $Month} do stuff here {/if} This fails. So thinking it was perhaps the leading zero, I tried the following, which failed equally: {if $Events[i].monthnum|regex_replace:"/^0/":" " > $Month|regex_replace:"/^0/":" "} So, then I tried: {if $Events[i].monthnum|string_format:"%d" > $Month|string_format:"%d"} And this fails too. So now I am really stumped. Any tips? My Smarty version is 2.3.1. -Erich-

« previous php.smarty.general (#11235) next »