in Education by
I cant figure out how to select the following: 123 -> 123.00000 123.12 -> 123.12000 123.123456 -> 123.123456 I would like to expand the number of decimal places to for example 5 decimal places (minimum) If there are no decimal places at all there should be 5 zeros. It is fine if there are more then 5 decimal places. SELECT ROUND(123,5) FROM DUAL; will result: 123 instead of 123.00000 The number has a default precision. Is this possible or should I convert it to a varchar with the oracle number formats? I am using Oracle 10g with plsql. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You could use the following: SQL> SELECT X, to_char(X, 'fm99999999.00000999') 2 FROM (SELECT 123 X FROM dual UNION ALL 3 SELECT 123.12 FROM dual UNION ALL 4 SELECT 123.123456 FROM dual); X TO_CHAR(X,'FM99999999.00000999 ---------- ------------------------------ 123 123.00000 123.12 123.12000 123.123456 123.123456

Related questions

0 votes
    I cant figure out how to select the following: 123 -> 123.00000 123.12 -> 123.12000 123.123456 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    Which button places the contents in the centre of the cells across a number of columns Select the correct answer from above options...
asked Dec 30, 2021 in Education by JackTerrance
0 votes
    How will you find whether a number is represented in Decimal/Binary/Octal or Hexadecimal? * O Through base O ... O Through numbers Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    each circular outward direction. Suggest her wh F.Soleil 1. Convert (655) in binary number: 2. Convert (487) ... 3. Compute 10001-1111 Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    Write a program to convert a decimal number into binary number using function Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    11. Express the decimal format of the signed binary number (10010)2 O a) 2 b) 12 O c)-12 Co O d)-2 Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    Define and Explain. 1. Decimal Number System. 2. Binary Number System. 3. Octal Number System. 4. Hexadecimal Number System. Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Define and Explain. 1. Decimal Number System. 2. Binary Number System. 3. Octal Number System. 4. Hexadecimal Number System. Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    convert these decimal number into binary no. 1) 987 2) 987 Select the correct answer from above options...
asked Dec 9, 2021 in Education by JackTerrance
0 votes
    convert these decimal number into binary no. 1) 987 2) 987 Select the correct answer from above options...
asked Dec 3, 2021 in Education by JackTerrance
0 votes
    Convert the following decimal number to their binary equivalent 52.0625 Select the correct answer from above options...
asked Dec 2, 2021 in Education by JackTerrance
0 votes
    if 1100101011 is in binary number system then what will be the ans in decimal number system. Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    . What is the binary equivalent of the decimal number 368 Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    Express the decimal number 68.5 in i) bcd code ii) xs-3 code iii) gray code Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    - Conveset (321),0 - binary number System (3) Subtract: (1100) A. (3) (1001) (1000) (3) Add : Convert (4 ... Multiply: (101). X (11 1) Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
...