dongyu4455 2013-01-27 18:58
浏览 20
已采纳

不回显全字符串

I have google coordinates that I have to change, but when I echo them, for example,

echo (string)28.9871692657471;

I get the result of

28.987169265747

" 1 " at the end disappears

echo (string) 28.9875984191895

" 5 " at the end disappears

I tried directly echoing it, without casting, but nothing has changed, the thing I want to do is to have this basic operation,

28.9875984191895 + 0.0000000000001 = 28.9875984191896

Is there something I am missing ? because I could not find anything about that when I search on the internet

  • 写回答

3条回答 默认 最新

  • duanmeng3476 2013-01-27 19:58
    关注

    Give this a try

    echo bcadd("28.9875984191895", "0.0000000000001", 13);
    

    The last parameter is the number of decimals to display

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失