[SR-Users] Float Comparison

Alex Hermann alex at speakup.nl
Thu Aug 25 13:28:03 CEST 2011


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 5 decimals in the
> fractional part, for real value 1.5 I will get 1.50000

If the column is a NUMBER(n,prec)/DECIMAL(n,prec) type, at least mysql returns 
it with full precision. In Kamailio they're converted to string, after which 
the above transformation works.

Maybe even direct string comparison can be used on two fixed point values (as 
string) with equal precision.

-- 
Greetings,

Alex Hermann




More information about the sr-users mailing list