<div dir="ltr"><div><div><div><div><div><div>Hi all,<br><br></div>I am wondering if there is an option to stop the function "tofloat" from rounding. Here is a simple example that explains the problem:<br><br>abc  = (/"130511001","130511002","130511003","130511004","130511005","130511006"/)<br>cde1  = sprintf("%10f",tofloat(abc))<br>cde2  = toint(cde1)<br>cde3  = toint(abc)<br><br>print(abc+" = "+cde1+" = "+cde2+" = "+cde3)<br><br></div>This results:<br><br>(0)     130511001 <span style="color:rgb(255,0,0)">= 130511000.000000 = 130511000</span> = 130511001<br>(1)     130511002 <span style="color:rgb(255,0,0)">= 130511000.000000 = 130511000</span> = 130511002<br>(2)     130511003 <span style="color:rgb(255,0,0)">= 130511000.000000 = 130511000</span> = 130511003<br>(3)     130511004 <span style="color:rgb(255,0,0)">= 130511008.000000 = 130511008</span> = 130511004<br>(4)     130511005 <span style="color:rgb(255,0,0)">= 130511008.000000 = 130511008</span> = 130511005<br>(5)     130511006 <span style="color:rgb(255,0,0)">= 130511008.000000 = 130511008</span> = 130511006<br><br></div><br>This loss of precision could be acceptable if the values were some data numbers, however, if these are unique station IDs then this is not correct.<br><br></div>I know the solution is simply use "toint" or "todouble" to avoid this situation. Just curious if a rounding option is possible in "tofloat".<br><br></div>Cheers,<br></div>Rashed<br><div><div><div><div><br><div><br><br><br><div><br><br></div></div></div></div></div></div></div>