Just to inform, FYI...
(rtos num 2 0) can give undesired results when number is enormously large, i.e. (around 1e+15 or 1e+16)... Test it with some still writable number that don't exceed numerical notation...
We can conclude - everything you do in ACAD, you must do in some legit limits (neither too big numbers nor too small - 1e-15) - no wonder that many have asked why for ex. IntersectWith method don't find intersections - their DWGs contained reference curves far away from 0,0,0 origin point (1e+10 or similar)...