简体   繁体   中英

Oracle To_Char function V in format string

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.

The code is:

TO_CHAR(QTY_DISPENSED,'0000000V000') 

What does the V do?

Jeff

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM