calculate length of line in mapbasic

hello everyone,

I am working on a MapBasic code and I have a problem. I wrote a code that calculates the length of the line that the user clicked on. my program calculates the length of the line. The program I write separately writes the start and end points of the line.
the first question I want to ask you is how can I show the number of decimal digits of the starting and ending coordinates of the line shown by the program as 3 digits? the returned values either show two digits or do not appear in decimal digits.
the second question I want to ask you is:
  the line length calculated with the program I wrote differs from the line length calculated with the calculator. what is the reason of this?
I converted the layer of the line object I draw in Mapinfo software to shape format using the Universal Translator tool.
I opened the table in ArcMap. the length of the same line in the table is very close to the length I calculate with my calculator. The result value I found in Mapinfo is not the same as the result I found in ArcMap.
I wrote another program using MapBasic. I created a dialog in the program. In my program, the user creates points in the layer with the X - Y coordinate values written in edittext. I created two points with the mapbasic program that I wrote. the program also writes the X - Y coordinates of the points on the screen after creating the point. when using the program I entered three digits of the decimal digits of the point coordinates. but the X - Y coordinates on the screen appear as two digits. I measure the distance between two points using the ruler in Mapinfo program. I also calculated the length using the X- Y coordinates that appear on the screen with the calculator. The length value that the ruler in Mapinfo finds is not the same as the length value I calculated.
When I tried the program I wrote in Mapinfo software, I set the projection of the layers I created as Türkish Coordinate Systems (3 degree k = 1 ITRF) Cenral Meridian 33. 
Where am I doing wrong? Could you help me with this?
Thanks everyone
The mapbasic program code I wrote is below.
Include "MapBasic.def"
include "icons.def"
Declare Sub Main
declare sub uzunluk_bul
Sub Main()
create buttonpad "Cizgi" as
toolbutton
calling uzunluk_bul id 1
helpmsg "Çizgi Seç\nÇizgi Seç"
End Sub

sub uzunluk_bul
dim i, kayit_deger, obje_tip, pencere_id as integer
dim tablo_ad as alias
dim x_tık, y_tık as float
dim xbas, xson, ybas, yson ,uzunluk as float
dim obje as object
set coordsys window frontwindow()
pencere_id=frontwindow()
if windowinfo(pencere_id,WIN_INFO_TYPE)<>WIN_MAPPER then
print chr$(12)
print "Bu araç harita penceresinde olmayan bir pencerede kullanılamaz"
else
x_tık=commandinfo(CMD_INFO_X)
y_tık=commandinfo(CMD_INFO_Y)
i=searchpoint(frontwindow(),x_tık,y_tık)
if i=0 then
print chr$(12)
Print "Bir Çizgi Seçmelisiniz"
elseif i=1 then
tablo_ad=searchinfo(i,SEARCH_INFO_TABLE)
kayit_deger=searchinfo(i,SEARCH_INFO_ROW)
fetch rec kayit_deger from tablo_ad
tablo_ad=tablo_ad+".obj"
obje=tablo_ad
obje_tip=objectinfo(obje,OBJ_INFO_TYPE)
if obje_tip=OBJ_TYPE_LINE or obje_tip=OBJ_TYPE_PLINE then
xbas=objectgeography(obje,OBJ_GEO_LINEBEGX)
xson =objectgeography(obje,OBJ_GEO_LINEENDX)
ybas=objectgeography(obje,OBJ_GEO_LINEBEGY)
yson=objectgeography(obje,OBJ_GEO_LINEENDY)
uzunluk=round(sqr((yson-ybas)^2+(xson-xbas)^2),0.001)
print chr$(12)
print "uzunluk: " +uzunluk

print "xbas: "+xbas+" ybas: "+ ybas
print "xson: "+xson+" yson: "+ yson
else
print chr$(12)
print "Seçtiğiniz Obje Doğru veya Çoklu Doğru objesi değil!"
end if
end if


end if

end sub