Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bug in foxpro

Status
Not open for further replies.

desert227

Programmer
Apr 8, 2008
13
CA
I created a table with a rate in it of N(5,2). In the master file, the rate was N(7,2). When I inserted the master rate into the created table, a rate of 191.25 was stored as 191.30

basically code is
select master
store rate to m.createdrate

insert into created from memvar

I you wait window before insert, m.createdrate is correct

When you browse created, the rate is 191.3

I changed the created table to have rate of n(7,2) and rate is ok.
 
That's not a bug. By creating the field at N(5, 2), you set a maximum length of five characters, two of which come after the decimal. That means, with two decimals points, the maximum value is 99.99. Since "191.25" is six characters long, the value must be truncated by one character to fit in a N(5, 2), which when rounded off becomes 121.3.


--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thanks - will save me a lot of headaches. always thought it meant 5 digits, 3 before decimal and 2 after....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top