PHP Weight Calculation Fix
- or -
Post a project like this1432
£20(approx. $25)
- Posted:
- Proposals: 3
- Remote
- #2827501
- Awarded
Description
Experience Level: Entry
Estimated project duration: Ongoing
The ultimate problem that I cannot find an answer to!
We have a web form that inserts weight into a my sql database as an example (user inputted) figure 50.2 (this being 50lbs and 2 oz)
We are converting this amount into ounces to keep things simple within the DB
We then sum up all the weights to gain1 total weight
Everything works fine and they seem to add up correctly the only issue is the lbs and oz are not displaying correctly as we know there are 16 oz in a pound.
As an example which is attached we have weights of 10.14 and 10.03 if we add these together we get 20.17 which is technically correct but in lbs and oz is wrong it should show 21lb 1oz
Putting it even simpler 17 oz should should be displayed as 1lb 1oz
We are currently use the following formula for converting ounces to pounds:
php echo $row_Recordset4['totalsum'] /16
We are only want to show the correct weight output of lbs and oz
I have searched around for something to do this for ages and found nothing anything would do even java script if possible.
We have a web form that inserts weight into a my sql database as an example (user inputted) figure 50.2 (this being 50lbs and 2 oz)
We are converting this amount into ounces to keep things simple within the DB
We then sum up all the weights to gain1 total weight
Everything works fine and they seem to add up correctly the only issue is the lbs and oz are not displaying correctly as we know there are 16 oz in a pound.
As an example which is attached we have weights of 10.14 and 10.03 if we add these together we get 20.17 which is technically correct but in lbs and oz is wrong it should show 21lb 1oz
Putting it even simpler 17 oz should should be displayed as 1lb 1oz
We are currently use the following formula for converting ounces to pounds:
php echo $row_Recordset4['totalsum'] /16
We are only want to show the correct weight output of lbs and oz
I have searched around for something to do this for ages and found nothing anything would do even java script if possible.
Mark H.
99% (21)Projects Completed
23
Freelancers worked with
22
Projects awarded
43%
Last project
6 Oct 2022
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies