|
| |
|
|
pd_it_guy
Posts: 193 Joined: 3/4/2008 Status: offline
|
pHp problems - 9/15/2008 16:47:24
Can anyone tell me what is going on here. This is a typical row in some data coming in from a SQL Server. All set to numeric (18,0), and verified in Excel as numeric. Browser is I/E. rin=102 primary_key=200823344 prop_exh_number=33195 When I do a query in asp, with ADO, for this row, I get exactly the expected results, 102, 200823344, and 33195 When I do a query in pHp, I get instead, 102.00, 200,823,344.00, and 33,195.00. The string variables come through as expected. pHp appears to be adding in the thousands separators and two decimal points on its own. We want an integer, with no commas, and no decimal points. So I thought maybe, it thinks its a precision and not an integer? So, I read you can convert a variable to an integer in pHp, by an intval($variable). That fixed the decimal points, all right, but stopped at the first thousands separator, thus: 102, 200, and 33. Then I tried multiplying the variables by 1 to force them to be an integer, like it or not. That got me the same results, 102, 200, and 33. All I want to see is numbers. OK.... I did eventually manage to fix it so it looked right by stripping out the commas (str_replace)and did an intval($) routine which got rid of the decimals but am left with the rather bothersome question of how the commas and formatting got there in the first place, in what should have been a purely numeric variable.
< Message edited by pd_it_guy -- 9/15/2008 20:27:59 >
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|