Ratio on irc bugged

Started by Lesbian, Dec 06, 2017, 01:34 PM

Previous topic - Next topic

Lesbian

what's the problem / i use it on irc


Murdock

I think the problem is a division by zero, not sure though

Lesbian

Quote from: Murdock on Dec 07, 2017, 08:44 AMI think the problem is a division by zero, not sure though
Hi murdock Thanks for your help you're right it  was division with zero.Any way to stop it ? mean if the kills are 0 then it don't gives ratio 

!

Replace it with.
local ratio = 0;
if ( GetSQLColumnData( q, 4 ) != 0 && GetSQLColumnData( q, 5 ) != 0 ) {
   ratio = format( "%.2f", GetSQLColumnData( q, 4 ) / GetSQLColumnData( q, 5 ) );
}

Discord: zeus#5155