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

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

问题描述

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

如何强制oracle总是显示小数位?



谢谢

解决方案

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

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

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


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.

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

Thanks

解决方案

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天全站免登陆