Page 1 of 1

browsertools + smarty number sorting

Posted: Sun Aug 14, 2011 8:32 am
by msaluste
Hi!
I'm using BrowserTools to detect the version of browser and check if it is the latest one.
It's all good until browser version reaches 10 and above. For example, Google Chrome version 13.x is considered older than Chrome 1.x-9.x by the following Smarty code:

Code: Select all

{elseif $browser_name=="Chrome"}
{assign var='Latest' value='13.0.782.112'}
{if $browser_version<$Latest}
...
{else}
...
{/if}
So the default sort order goes like this: 1, 10-19, 2, 20-29, 3, etc.
How can I tell Smarty that numbers 1-9 are not greater than 10 (or sort the mess out otherwise)?