Oracle To_Char函数V的格式字符串 [英] Oracle To_Char function V in format string

查看:222
本文介绍了Oracle To_Char函数V的格式字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了Oracle代码,正在尝试弄清楚它在做什么.具体来说,它是将数字转换成字符串,我听不懂.

I was given Oracle code and I'm trying to figure out what it is doing. Specifically it's converting a number to a string and I don't understand it.

代码是:

TO_CHAR(QTY_DISPENSED,'0000000V000') 

V做什么?

杰夫

推荐答案

这是用于将数字转换为字符串的格式模型":

It's a "Format Model" for converting numbers to strings: https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm

返回一个乘以10n的值(如有必要,将其向上舍入),其中n是V后面的9的个数.

Returns a value multiplied by 10n (and if necessary, round it up), where n is the number of 9's after the V.

因此,基本上是将QTY_DISPENSED乘以1000,然后返回一个字符串.

So basically it's taking your QTY_DISPENSED multiplying it by 1000 and returning a string.

这篇关于Oracle To_Char函数V的格式字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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