php 变量有助于处理大量数据
你好,我需要知道 php 是否有一个变量类型不向我显示如下内容:
3.9614081257132E+28
请问有人知道如何制作吗?
Hello i need to know if php there is a variable type that doesn't show me something like this:
3.9614081257132E+28
Please anyone knows how to make that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试
printf()
打印变量:或者不带小数位:
如果需要任意精度数字,请尝试 bcmath 和 GMP 模块。
Try
printf()
to print the variable:Or without the decimal digits:
If you need arbitrary precision numbers, try the bcmath and GMP modules.
您得到的只是显示“长”实数的标准方式。
对于这些操作,您可能还需要查看此主题:如何在php中解析长值?
What you get is just a standard way of displaying "long" real numbers.
for operations with those, you might also want to review this topic: How to parse long value in php?
PHP 中没有“big num”类型。然而,实际上没有什么可以阻止您构建一个能够表示大整数的类。您可以使用字符串数据类型来执行此操作。
There are no "big num" types in PHP. However, there really isn't anything to stop you from building a class that is capable of representing a big integer. You can do this with the string data type.