Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/tbl_float'
Browse files Browse the repository at this point in the history
  • Loading branch information
salhk committed Jul 16, 2024
2 parents 179ca69 + bf09361 commit 868167d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tables/tables.tbs
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,13 @@ public function tbl_field_sg(byref field_name as string,byref field_value as str
dim tmp_f as float=0
strtobin(tmp_f,s,4)
field_value=fstr(tmp_f)
dim pos as byte = instr(1,field_value, ".", 1)
if pos <> 0 then
if instr(1,field_value,"-",1) <> 0 then
pos=pos-1
end if
field_value=ftostr(tmp_f,FTOSTR_MODE_PLAIN,pos+99)
end if
if tbl_field_info(field_index).field_type=EN_TBL_FIELD_TIME then
p1=0
p2=86400
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.tbs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function ftofixed(r as real, decimals as byte) as string
if instr(1,ftofixed,"-",1) <> 0 then
pos=pos-1
end if
ftofixed=ftostr(r,FTOSTR_MODE_AUTO,pos+decimals-1)
ftofixed=ftostr(r,FTOSTR_MODE_PLAIN,pos+decimals-1)
end if
end function

Expand Down

0 comments on commit 868167d

Please sign in to comment.