总是在 SQL 中显示小数位? [英] Always show decimal places in SQL?

查看:40
本文介绍了总是在 SQL 中显示小数位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个返回数值(货币)的查询.其中一些值是整数,显示为 3、5、2 等,而其他数字则显示为 2.52、4.50 等.

I'm working on a query which returns numeric values (currency). Some of the values are whole numbers and are being displayed as 3, 5, 2 etc whilst other numbers are coming up like 2.52, 4.50 etc.

如何强制 oracle 始终显示小数位?

How can I force oracle to always show the decimal places?

谢谢

推荐答案

TO_CHAR(pAmount, '9,999,999.99');

http://www.techonthenet.com/oracle/functions/to_char.php

http://www.ss64.com/orasyntax/to_char.html

这篇关于总是在 SQL 中显示小数位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆