Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does php prevent numbers from being displayed as scientific counting

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces how php prevents numbers from being displayed as scientific counting. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

You can use the formatted number function "number_format ()" in PHP to prevent numbers from being displayed as scientific counting, using methods such as "echo number_format (" 5000000 ", 2,". ");.

This article operating environment: Windows7 system, PHP7.1, Dell G3 computer.

How does php prohibit scientific counting? PHP prevents numbers from being displayed as scientific counting

When you meet scientific notation

The solution is

Use php to format the numeric function: number_format ()

The method of use is as follows:

Echo number_format ("5000000").

"/ / 5000000echo number_format (" 5000000 ", 2)."

"; / / 5000000.00echo number_format (" 5000000 ", 2,". "); / / 5.000.000pr 00

There is also an online chestnut:

/ / for example, echo '1869879738796128 enumerator / default result is: 1.8698797387961E+15 / / solution echo number_format (' 1869879738796128, 0,','); / / output result is: 1869879738796128 on how to prevent the display of numbers as scientific counting, so much for sharing here. I hope the above can be helpful and learn more. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report