I've searched everywhere and even php and mysql's websites as well as stack overflow. I've never learned how to do this and I guess I'll just ask the question.
I have a form that captures information. Say fields: grandtotal, expensetotal, and spendable. I'd like to use the php echo to populate the information. Currently I've been using the text field and I think having the echo would be cleaner display.
In addition, if the information in the fields are just numbers say 18923 is there an easy way with the php echo to have it display $18,923 ?
So I don't know what information is need.
Table name is: u6tdn_budgetpage7
Field name is: grandtotal
I have a form that captures information. Say fields: grandtotal, expensetotal, and spendable. I'd like to use the php echo to populate the information. Currently I've been using the text field and I think having the echo would be cleaner display.
In addition, if the information in the fields are just numbers say 18923 is there an easy way with the php echo to have it display $18,923 ?
So I don't know what information is need.
Table name is: u6tdn_budgetpage7
Field name is: grandtotal
Figured it out!🙂
This will display the field:
<?php echo $data['grandtotal']; ?>
This will display the field as currency format:
$<?php echo number_format($data['grandtotal'], 2, '.', ',');?>
I'm having one small issue... I'm trying to input an {expense} in an email template and this won't populate anything.
I've tried
and this populates 0.00. Any ideas?
<?php
$form->data['expense'] = echo number_format($data['grandtotal'], 2, '.', ',');
?>
I've tried
<?php
$form->data['expense'] = number_format($data['grandtotal'], 2, '.', ',');
?>
and this populates 0.00. Any ideas?
HI manofstyle,
Where does $data['grandtotal'] get its value from? It looks as though this may be zero.
Bob
Where does $data['grandtotal'] get its value from? It looks as though this may be zero.
Bob
A form table called budget7. I use the same function earlier and it works. I just had an idea.
Added "form->" and works perfectly! ha
Here's the code:
Here's the code:
<?php
$form->data['expense'] = number_format($form->data['expensetotal'], 2, '.', ',');
?>
This topic is locked and no more replies can be posted.