Re: [SR-Users] Float Comparison

2011-08-25 Thread Daniel-Constantin Mierla
Hello, as mentioned before, script variables work only with integer or string values. In this case I suggest you load the values as string and then use Lua to compute what you want as float. Alternative, load as string (n the format integer.decimals) and split the value using transformation

Re: [SR-Users] Float Comparison

2011-08-25 Thread Daniel-Constantin Mierla
On 8/25/11 12:54 PM, Alex Hermann wrote: On Thursday 25 August 2011, Daniel-Constantin Mierla wrote: as mentioned before, script variables work only with integer or string values. In this case I suggest you load the values as string and then use Lua to compute what you want as float.

Re: [SR-Users] Float Comparison

2011-08-25 Thread Alex Hermann
On Thursday 25 August 2011, Daniel-Constantin Mierla wrote: On 8/25/11 12:54 PM, Alex Hermann wrote: If you just use fixed-point for fractional values, you can remove the dot and convert to int. $(var(float){s.replace,.}{s.int}) By fixed point do you mean when the fractional part has

Re: [SR-Users] Float Comparison

2011-08-25 Thread Daniel-Constantin Mierla
On 8/25/11 1:08 PM, Alex Hermann wrote: On Thursday 25 August 2011, Daniel-Constantin Mierla wrote: On 8/25/11 12:54 PM, Alex Hermann wrote: If you just use fixed-point for fractional values, you can remove the dot and convert to int. $(var(float){s.replace,.}{s.int}) By fixed point do you

Re: [SR-Users] Float Comparison

2011-08-25 Thread Alex Hermann
On Thursday 25 August 2011, Daniel-Constantin Mierla wrote: $(var(float){s.replace,.,}{s.int}) OK. I am not familiar with the deep details of database value types - to expect that it is a way that I can get always the trailing 0's for such value? For example, if I want a db column type with

Re: [SR-Users] Float Comparison

2011-08-23 Thread Brandon Armstead
Daniel, Sorry for taking so long to respond - I am still facing an issue with this (even in 3.1.4). I am loading the values from database. It looks as if the arithmetic operators are not functioning properly when the data is imported into kamailio from DB - I'm going to do some more research

Re: [SR-Users] Float Comparison

2011-01-20 Thread Daniel-Constantin Mierla
On 1/19/11 7:50 AM, Klaus Darilion wrote: Am 18.01.2011 21:26, schrieb Brandon Armstead: Hello, Is there anything special that needs to be done for float comparison? For example: if([5.5 = 4.3]) ^^^ this format is no longer supported starting with 3.0, just skip the square

[SR-Users] Float Comparison

2011-01-18 Thread Brandon Armstead
Hello, Is there anything special that needs to be done for float comparison? For example: if([5.5 = 4.3]) or if(5.5 4.3) The conditional does not seem to be coming back as true like it should? This is simply an example... the precision in the actual case is different (longer