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

如何将18000变为18,000.00作为输出? Mysql和php

I have data 18000 in my database and the datatype is decimal but the length of decimal is empty. How do I make it into 18,000.00 as an output?

You can use number_format() function here.

$number = 18000;

$formatted_number = number_format($number, 2, '.', ','); // Gives 18,000.00

Hope this helps.

Try FORMAT function in mysql.

Query

SELECT FORMAT(18000, 2);

Result

18,000.00

近期文章

  • llcom和sscom区别
  • 按照要求编写Java程序
  • python这个咋写呀
  • 怎么在Unity中用PoseStampedMsg消息类型?
  • java大一宠物商店问题
  • 关于正则表达式的问题等等1
  • python 嵌套循环加很多变量
  • 建立一个函数mystrip
  • python下位机,启动代码时报的错
  • caret包如何得到预测结果的误差(语言-r语言)
  • 我可以为另一个var分配一个值,我不知道是否存在于一行中?
  • 电脑触控板突然用不了要怎么解决
  • 关于#java#的问题:导致上传重复单据
  • You may have an infinite update loop in watcher with expression "columns" found in ---> <Table>
  • Python删除给定字符串的前后内容
  • mybtis-plus多表查询后实体类的数据不匹配
  • Leetcode 54. 螺旋矩阵为什么数组会下标越界
  • 前端实现网站首页静态化
  • 非本专业的想入行java
  • 用python将小写字母转换为unicode编码

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华