我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

FPDF中PHP的百分比计算

I am looking to make a percentage calculation on an FPDF based invoice template which contains $total (e.g 1000) and a number value $percentage (e.g. 20)

Ideally I would like this to display as discount

$pdf->Cell(100, 5, 'Discount' .$discountresult. '', 0, 'L');

How to achieve this? Some advice would be appreciated.

Like this:

$total = 1000;
$percentage = 20;

$discountResult =  $total - (($percentage / 100) * $total);

$pdf->Cell(100, 5, 'Discount' . $discountResult, 0, 'L');

近期文章

  • PHP,使页面自动检测管理员所做的更改
  • 如何使用HTML向传出的PHP电子邮件添加.png?
  • 使用php将json转换为csv无法获得正确的格式
  • php从标记中删除所有属性
  • PHP从utf8_general_ci转换为latin1_swedish_ci
  • 数据未插入数据库且没有错误
  • 安全的帐户注册
  • 使用RegEx获取字符串的特定部分
  • 在Magento 1.9.1.1中重新索引类别产品的问题
  • 从iframe中的页面打开链接作为普通页面
  • 我一直收到此错误警告:除以零
  • 获取提交最新记录的时间SQL
  • 如何在html标记中正确实现内联if语句?
  • 根据会话/ cookie限制对文件夹的访问
  • 如何避免使用codeigniter覆盖文件写入
  • Laravel表单POST重定向失败
  • 获取页面内容,就像用户打开一样
  • Php,undo mysql_real_escape_string
  • 如何在mysql结果之间放置广告?
  • 如何在php中实现循环[关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华