Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18521

Re: Form processing issue

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.javascript, comp.lang.php
Subject Re: Form processing issue
Date Fri, 15 Jan 2021 22:10:03 +0100
Lines 29
Message-ID <i6eelcF29trU1@mid.individual.net> (permalink)
References <rtsl27$2u66$1@gallifrey.nk.ca>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net hzTjbZEYEP6W3TQpWuLjDwwqBuxLxNGjHc0H9KRMcU2C4mhAys
Cancel-Lock sha1:Faq1WqegiwMyw+ueT0/hSmqXr3o=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1
In-Reply-To <rtsl27$2u66$1@gallifrey.nk.ca>
Content-Language en-US-large
Xref csiph.com comp.lang.javascript:39364 comp.lang.php:18521

Cross-posted to 2 groups.

Show key headers only | View raw


On 15/01/2021 18.57, The Doctor wrote:
> Got this form doing
> a calculation as follows:

> put the fraction in this case is
> coming out as 52.5.00 when it is suppose to pass
> 52.50 ?

Remove the '+ ".00"', you need to use number_format() in php to get the 
right number of decimals, see 
https://www.php.net/manual/en/function.number-format.php


> Given the above , how do I fix this?

I would suggest a clean rewrite of the whole thing, I would suggest 
node.js, angular, or something similar, just see to make ajax calls to 
fetch the raw data in json format from the backend (php or database).

Do not generate dynamic javascript in php, you will just end up with a 
code that is difficult to maintain and of course your teacher will fail you.


-- 

  //Aho


Back to comp.lang.php | Previous | Next | Find similar | Unroll thread


Thread

Re: Form processing issue "J.O. Aho" <user@example.net> - 2021-01-15 22:10 +0100

csiph-web