I have a file which I am processing using apache pig. I have a chararray field which I am casting to float, if the value of that field is less than 0, I want to make it integer 0 and if it is greater than zero, then keep the float number as it is. 

For ex: if number is -1234.56, make it integer 0. If number is 2345.67, keep it 2345.67

I am failing using the following code, Output is coming 0.0 and I want 0, due to which my job is failing. Please help.!

```
((float)field_name > 0 ? (float)field_name:(int)0) AS field_name,

```