Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

81
Views
Value Subtraction Script for PHP Variable

I would like a Value Subtraction Script, For Discount in REAL.

Example: the Customer makes a Purchase of $140.00 (Registered in the DB), on the Checkout Page, I want to print a Discount of $10.00

So that the value of $130.00 appeared to him, how could I do that with a simple script in PHP

<?=number_format($order[0]->total_order_value, 2, ',', '.'); ?>

//$140,00 to 130,00

How to do this magic with simple script inside this variable?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just do the subtraction in the argument to number_format()

<?php $discount = 10; echo number_format($order[0]->total_order_value - $discount, 2, ',', '.'); ?>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!