ini return only integer when type is numeric
Posted: Fri Aug 03, 2007 7:27 am
If a numeric value such as 100.50 is stored in an ini file, reading it back will return 100 not 100.50. The decimal part is somehow excluded. The following is the full scenario
1. App.ini contents:
2. The ini is then read in the following way
Instead of 6300 and 2473.50, I'll get 6300 and 2473 . How to fix this?
Am using FWH2.8 and the code was tested on an XP machine
Thank you
1. App.ini contents:
Code: Select all
[Balance]
BF_COL_K=6300
BF_COL_L=2473.50
Code: Select all
function readIni()
local oIni, aBF := array(2)
INI oIni FILE "c:\app\data\app.ini"
GET aBF[COL_K] SECTION "Balance" ENTRY "BF_COL_K" OF oIni DEFAULT 0.00
GET aBF[COL_L] SECTION "Balance" ENTRY "BF_COL_L" OF oIni DEFAULT 0.00
ENDINI
return nil
Am using FWH2.8 and the code was tested on an XP machine
Thank you