Welcome Guest, Not a member yet? Register   Sign In
multiply percentage (Using Codeigniter 3)
#1

I have 3 echo values that I need to multiply percentage directly on a view page:
$x1
$x2
$x3

Example:
$x1 = 1000
$x2 = 50
$x3 = 10
The following should be calculated:
x1 * x2 as% * x3 as%
Sum of this Example = 50


How should the calculation be with echo on the view-page?
Reply
#2

(This post was last modified: 11-13-2023, 01:07 AM by SubrataJ.)

You can do this 

Code:
<span>Sum of this Example = <?=  $x1 * ($x2 / 100) * ($x3 / 100) ?></span>
Learning Codeigniter 
Reply
#3

Perfect. Thank You!
Reply
#4

(This post was last modified: 11-13-2023, 01:16 AM by SubrataJ.)

You are welcome, please mark it as solved.  Big Grin
Learning Codeigniter 
Reply
#5

To mark it as [SOLVED] at this to your post title [SOLVED] at the end.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB