String Conversion in awk

I am porting a awk script from Windows to unix

I_SALE_MEDIA=$67
if ((I_VOID_FLAG == "Y") && (I_SALE_MEDIA == 0))

NOW consider the case where I_SALE_MEDIA i.e $67 is "000"

The above comparison works fine in Windows , but to make it work in
Unix , I had to change the above as follows :

I_SALE_MEDIA=$67
if ((I_VOID_FLAG == "Y") && (I_SALE_MEDIA == "000" ))

Such change had to be made thruout the script for similar situation.

From what I read awk should convert the I_SALE_MEDIA to numeric 0
and then compare successfully with the zero constant numeric literal .

Any suggestions why this is happening.

Regards
Rohan

if ((I_VOID_FLAG == "Y") && (int(I_SALE_MEDIA) == 0))

Thanks for the reply, but

Is there any other setting i.e Built in variables. or any other setting that affects how the string "000" is converted to 0 automatically in windows and not in Unix.

Cannot recall, but ....... CONVFMT is somewhat related, but I could not get it working as expected.

Here's another scenario:

BEGIN {
   VOID="Y"
   A="000"

   if ( (VOID == "Y") && (A == 0) )
      print "YES"
   else
      print "NO"
}

The above outputs "NO" for awk, nawk, /usr/xpg4/bin/awk and gawk [on Solaris].

BEGIN {
   VOID="Y"
   A=000

   if ( (VOID == "Y") && (A == 0) )
      print "YES"
   else
      print "NO"
}

The above outputs "YES" for all the awk's mentioned above.

This is somewhat strange, but doing 'man nawk' on Solaris:

Based on my examples, it seems like under Solaris the "context" of yje comparision is defined by the type of the LEFT expression.

Actually I just tried the same test under MKS's awk on Windows and does work the SAME as it does on Solaris. And also it behaves the same under Cygwin's awk and gawk under Windows as well - well, at least for the test scenarios I've outlined above.