[OpenSIPS-Users] number comparisons
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Mon Sep 27 17:09:21 CEST 2010
Hi Brett,
There are 2 issues here:
1) converting to numbers as memcache is working only with strings - so
after pulling a value from memcache, use the {s.int} transformation to
use the value as integer and not as a string
2) indeed floats are not supported at all - I suggest "moving the point"
in the float to get an integer ...like usrloc module need to work with Q
value which is 0.0 - 1.0. But it stores in DB as 0 - 10 value to avoid
floats.
Best regards,
Bogdan
Brett Nemeroff wrote:
> Hello List,
> I frequently have issue with number comparisons with avps. What's the
> right way to do it? Say for example, both avps are populated from
> memcache lookups and the numbers float.
>
> I understand that most of opensips doesn't really support floats. So
> if I just wanted to compare the integer component, how could I do that?
>
> Thanks,
> Brett
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro
More information about the Users
mailing list