For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > April 2005 > Calculating









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Calculating
Test

2005-04-25, 3:57 pm

Hi all PHP gurus,

how can I solve this:
I have filled variable total (total oredr)
This variable I must recalculate before sending, ie (look at HERE word)

total = 100

Example
---------------------
function process_button() {
global $order;

$process_button_string = web_draw_hidden_field('x_login', blah blah
....) .


HERE web_draw_hidden_field('x_amount',
number_format($order->info['total'], 2)) .

Here must total be not 100, but divided with 5.85

How can I do that?

I have tryed
web_draw_hidden_field('x_amount', number_format($order->info['total/5.85'],
2)) .
but did not work

Thank you


BKDotCom

2005-04-25, 8:55 pm


Test wrote:
> web_draw_hidden_field('x_amount',

number_format($order->info['total/5.85'],2))

does $order->info['total/5.85'] exist?

what you want is number_format($order->info['total']/5.85,2)

Test

2005-04-25, 8:55 pm


> Test wrote:
> number_format($order->info['total/5.85'],2))
>
> does $order->info['total/5.85'] exist?
>
> what you want is number_format($order->info['total']/5.85,2)


Ahhh... thank you


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com