1、Java中的转换:
String result = new java.text.DecimalFormat("#.00").format(Math.PI);
2、MySQL中的转换方法一:
SELECT
CAST(
META_PRICE AS DECIMAL (18, 2)
) AS price
from cht_sku
3、MySQL中的转换方法二:
SELECT FORMAT(META_PRICE,2) AS price from cht_sku
微信扫一扫
1、Java中的转换:
String result = new java.text.DecimalFormat("#.00").format(Math.PI);
2、MySQL中的转换方法一:
SELECT
CAST(
META_PRICE AS DECIMAL (18, 2)
) AS price
from cht_sku
3、MySQL中的转换方法二:
SELECT FORMAT(META_PRICE,2) AS price from cht_sku
相关推荐