In Oracle number format

Hi all

I have a requirement like this

1. in my Oracle database, I have a column Number type (38,10)
2. According to the requirement of user I want to store the numbers as 12.450000 as it is.
When this number (12.450000) gets into the system, it is automatically converted to 12:45, but I still need the user entered number

For example, one tell me a solution for this

Thank you
Padma

Padma says:
Hello

Don't say unnecessary things. If you do not know the answer just better be quite.

Why do you think that the answers of FlyingGuy was not necessary or that he did not know the answer.

He was be truthful. Mathematically there is no difference between 1.0, 1.0000, 1.000000000000 etc.

If the numbers are numbers so they must be stored as numbers. If a "user" must be able to see a number with a certain number of digits after the decimal point, so this has nothing to do with the way the data is stored on the database, but is rather a UI issue, such that the interface needs to format the number to a varchar2 for exhibition purposes (using for example TO_CHAR (numbercol ((, 'fm990.0000000000')) so that the correct number of digits after the decimal point are shown. A user cannot reasonably hope that if they enter 0 5 leak so when they see the data once again, it will have 5 0 leak or if they get 10 completed 0 it appears again with 10 end of 0. It's not how to work the numbers and not how they should be stored in the database.

* with moderators hat on * please show more respect for people who are trying to give you the correct answers. Just because you didn't understand the answer only gives you the right to be offensive to people. * Moderators hat off *.

Tags: Database

Similar Questions

  • Column/data varchar but req number formatting when digital.

    Hello

    I wrote some sql to retrieve data from our Oracle database.

    Number formatting is a bit unfortunate.

    The column reads:

    1 000 000

    0.010

    1 000

    0.0009

    9999999.000

    -

    null

    > NWG

    If its not all of the numbers, but if it is a number, I need to correctly format i.e.

    without decimal places if they are just led 0

    I hope that there is a regular expression that I can use to format numbers ignoring the character entries.

    Any suggestions?

    Hello

    Whenever you have a question, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the accurate results you want from this data, so that people who want to help you can recreate the problem and test their ideas.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

    What do you mean by "if it's a number"?  The following could all be considered numbers:

    • -1
    • -1.2E + 3
    • $9,987,54
    • 123 456,7
    • 3/4

    Depending on what you consider a 'number', you can use expressions regular, perhaps combined with other string manipulation functions, like to TRANSLATE.

    You can consider a function defined by the user who tries to convert it to a NUMBER, but never to raise an error.  See How to determine if a Varchar2 string has characters from a to z?

    Which type of formatting you want for the numbers?  You said that you don't want to end ' 0 decimal, but how about a trailing decimal point?  When you post the sample data and results, examples of all individual cases, you want to manage.

    You may need TO_CHAR and then some channel, for example, RTRIM or REGEXP_REPLACE mainpulation functions.

    As you realize you probably now, it's a really bad design.  You let people in chains that may or may not represent the numbers, then, much later, trying to guess the whehter they meant it to be number, and if so which COMP.  Guess, isn't a very good way to solve problems.  The person who knows the data if it is a number or not - make him tell you at the point where it enters the number.  For example, instead of having 1 VARHCAR2 column, you may have 2 columns (a VARCHAR2 and a NUMBER) and a CHECK constraint that requires at least 1 of them to be null.

  • number format conversion

    Hello

    I have an external table that uses German digital format.

    either 100.00 would be 100.00 in English.

    Let's say the data is helping the GE_CSV table.

    SELECT GE_CSV RECIPES

    Returns:

    100.00
    200.00
    300.00

    etc.

    What is the best way to convert it to an English number format.

    Best regards
    Adam
    SQL> with t as (
      2             select '1,00' revenue_str from dual union all
      3             select '10,00' from dual union all
      4             select '100,00' from dual union all
      5             select '1000,00' from dual union all
      6             select '10000,00' from dual union all
      7             select '100000,00' from dual
      8            )
      9  select  revenue_str,
     10          to_char(to_number(revenue_str,'99999999D9999','nls_numeric_characters=,.'),
     11                  '99999999D99','nls_numeric_characters=.,') revenue_num
     12    from  t
     13  / 
    
    REVENUE_S REVENUE_NUM
    --------- ------------
    1,00              1.00
    10,00            10.00
    100,00          100.00
    1000,00        1000.00
    10000,00      10000.00
    100000,00    100000.00
    
    6 rows selected.
    

    Or simply this:

    SQL> with t as (
      2             select '1,00' revenue_str from dual union all
      3             select '10,00' from dual union all
      4             select '100,00' from dual union all
      5             select '1000,00' from dual union all
      6             select '10000,00' from dual union all
      7             select '100000,00' from dual
      8            )
      9  select  revenue_str,replace(revenue_str,',','.') revenue_num
     10    from  t
     11  / 
    
    REVENUE_S REVENUE_N
    --------- ---------
    1,00      1.00
    10,00     10.00
    100,00    100.00
    1000,00   1000.00
    10000,00  10000.00
    100000,00 100000.00
    
    6 rows selected.
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]

  • All excel cell number format using "excel cell format.vi set.

    Hi all

    I am writng 12 numbers to Excel cell, but it seems to me that 2.00207E + 11 instead of 200207106040. I use entire excel function cell phone format.vi but it is not useful, because I have no number format...

    Reference in the image file setting a VI.

    Thank you

    Got the answer.

  • Model number format comma and dot (.) appear as 'u' a bad

    When I saw the pdf at the local level, the number worked well, for example '1000'-> '1 '000.00 '.

    But I run in eBS, the number format do not work, for example, '1000'-> '1u000n00 '.
    I put the number as format below:
    <? format-number: SUM_AMOUNT_D; '9G999G999G999G999D99 '? >

    I also change the format of '9G999G999G999G999D99' to ' #, #, #, #, #. 00'. it still does not work.

    Help, please

    Thank you

    KP

    Model number format comma and dot (.) appear like 'u' and ' don't (Doc ID 760434.1)

  • I'm looking for a list of commands/syntax for number formatting. Example of ^ 1, ^ #, ^ t, etc...

    I'm trying to find a list of command/syntax that can be used in number formatting (bullets and numbering - style - dial number field).  I found a few examples, but I keep a list of available commands.  I searched, but was unable to find it.  Presumably, I'm using the wrong search terms.

    I don't think, because these are only a few. In the automatic numbering of the paragraph style settings dialog box, you have a drop down menu where you can select the formats that are then entered in the form of these shortcuts.

  • Number formatting Question

    Hi all..

    Please help with this question number formatting.

    I think that this question could have asked a lot of time, but I could not able to find the answer.

    I would format a number with 3 decimal places

    I mean.

    Ex:

    123456 to 123456.000

    12.1 to 12,100

    12.12 to 12.120

    12.123 to 12.123

    12.1234 to 12.123

    1234.12345 to 1234.123

    Please help me with this.

    Thank you

    Use TO_CHAR and mask format:

    SQL> -- generating sample data:
    SQL> with t as (
      2  select 123456 n from dual union
      3  select 12.1 from dual union
      4  select 12.12 from dual union
      5  select 12.123 from dual union
      6  select 12.1234 from dual union
      7  select 1234.12345 from dual
      8  )
      9  --
     10  -- actual query:
     11  --
     12  select n
     13  ,      to_char(n, '999999d000') c
     14  from   t;
             N C
    ---------- -----------
          12.1      12.100
         12.12      12.120
        12.123      12.123
       12.1234      12.123
    1234.12345    1234.123
        123456  123456.000
    6 rows selected.
    
  • In RTF model number format

    Hello

    I have a form field on a RTF model and its value is a number positive or 0.
    I see positive numbers in braces and zero strapless.


    The number Format that I use at the moment (#, # 0.00), which is also puts braces around zero.

    Here is an example of how I need to display the positive numbers and zero.


    Example:

    Value: 201.53
    Display: (201.53)

    Value: 0
    Display: 0.00


    Thank you
    Yogi

    Published by: user3209802 on February 21, 2013 22:03

  • Custom number format function does not return 0 in decimal form

    Hello

    My custom number formatting feature does not work. It was working fine when the site has a standard client server architecture. However, when we changed using the REST API with javascript and HTML 5 function works for most except in cases when I need it displays 0 for decimal numbers.

    Basically, the function accepts arguments a number and the number of decimals and returns the number rounded the number of decimals. Below, I've stripped naked function minimum, even I was testing.

    < cffunction = "dispCostPeriod" access = "remote" returntype = "string" output = "false" hint = "name costs for a specified period at the user" >

    < name cfargument = "in_decCost" type = "numeric" required = "yes" / >

    < name cfargument = "in_iRound" type = "numeric" required = "yes" / >

    < cfset decRoundedNum = NumberFormat (in_decCost, "_" & RepeatString("9",in_iRound)) >

    < cfreturn decRoundedNum / >

    < / cffunction >

    When I pass 55.00089 and 3, the function returns 55.001.

    When I was 55 or 55.000000 or 55.0000089 and 3, the function returns 55

    . And I need to 55,000.

    I tried both for returntype 'string' and 'digital', various masks as _.999, _.000, _. ___.

    I tried NumberFormat (in_decCost, "_.000") straight back.

    Nothing works.

    I use CF10 on Windows Server 2008.

    Any help much appreciated.

    Thank you

    Gena

    Can you explain how the data gets into the browser as a JSON string format?

  • Showing the positive sign as the number Format

    Hi all

    Is it possible to set the number format (custom format) to show the positive with the positive (+) sign numbers in front of the number (for example, + 2, + 2.3 + 0,0, etc.).

    I don't want to ride the number as a string and perform a concatenation. So, is it possible to do this using a custom number format?

    Thank you very much!

    Hello

    You can try to use the custom format and specify as below:
    +#,###;-#,###

    I tried this in 10g and seems to work very well.

    Thank you
    Hyder

  • Number format not valid in the data transfer Assistant

    I'm trying to download data from a CSV file in a table via the download data wizard. However, it always seems to fail on some lines with an error "invalid number format". Even if I stick one of these lines in the wizard, it still does not work. There is nothing wrong with the data, and I can do a regular insert Toad with no problems.

    The data are:
    28126238,101, RM, 29/01/2011

    The table looks like this:
    CREATE TABLE STR_PROD_UPLOAD
    (
    NUMBER OF PROD_CD,
    NUMBER OF STORE_CD
    CHARACTER VARCHAR2 (10 BYTE),
    DATE OF REPL_START_DT
    )

    It works very well on Toad:
    INSERT INTO STR_PROD_UPLOAD)
    STORE_CD,
    PROD_CD, line, repl_start_dt)
    VALUES (to_number('101'), to_number('28126238'), 'RM', to_date('1/29/2011','MM/DD/YYYY'));

    Anyone have any ideas on what might be wrong or how I can go about the matter of finding?

    FYI - evolution STORE_CD of a varchar2 and PROD_CD solves the problem, but I would like to know if it is possible to solve this problem for later use.

    Thx John

    Hi John,.

    For some reason, I get the same error. However with the download of the data, you can still provide you own number format in the case where the application could not a defined automatically. In your case, using Date / field number Format (for example: 99999999) will force the system to use the supplied format.

    Concerning
    Patrick

  • How to use FM format in the model number format

    Hi all
    Anyone could explain what is the element format FM for model number format? I've read the documentation, it does not show a clear description that it the section model Format Datetime.

    Kind regards
    Valerie

    What is the element format FM for model number format?

    It removes the space left is allocated for additional info, for example a sign:

    SQL> select length(to_char(0, '0')) len1, length(to_char(0, 'fm0')) len2 from dual
    /
               LEN1            LEN2
    --------------- ---------------
                  2               1
    1 row selected.
    
  • Number format for a thousand

    Hello

    I have a feature attribute of type BigDecimal with the type value equal to the number format.
    Its format string is ' # # 0.00' (for the thousand characters '' instead of' ' value), but on the record, there is no space on outputText or inputText.» How can I have the desired rendering?

    What I suggested was to use a comma in your af:convertNumber (model = "#, # 0.00") and change the group number trinidad-config.Xml file separator.

    If you don't want space as a separator of grouping in the world, you can write your own number converter (not difficult).

    John

  • Apex: Number Format

    How to remove the comma from number format * 99G99G99G99G90D000 * in the Apex?

    Yogesh

    To remove the commas, remove all G, for example. 9999999990D 000.

    If you want to remove the decimal, remove the D, for example. 99G99G99G99G90.

    Elsie

  • Convert or map Typedonnees decimal Transact-SQL for Oracle Number data type?

    MSSQL 2005
    Oracle 10.2 g

    In a MSSQL table, I have a column with the data type set on (decimal (1.0), null) with the values of line-1. (695 lines in total)

    In the Oracle table, the proposed mapped column is a number data type. When I import data, I received 695 errors with the message "invalid value for the field. How to properly convert or map Decimal (MSSQL) Transact-SQL for Oracle Number data type for a negative value?

    Thank you.

    How do you load data into Oracle? What tool or programming language you are using? Can you post something cause what you stated in your post should work, but there may be some ODBC, or other type of conversion factors to be taken into account.

     > create table t1 (field1  number(1,0));
    
    Table created.
    
     > insert into t1 values (-1);
    
    1 row created.
    
    UT1 > select * from t1;
    
        FIELD1
    ----------
            -1
    

    HTH - Mark D Powell.

Maybe you are looking for

  • HDMI port defective by design?

    Same problem here - I want to (Oh, man I need) to be able to use my HDMI port to make presentations on an external monitor. I recently converted to the technosystem to Apple after being forced by the former employer to abandon in favor of Windows App

  • combining the 2 screws

    So I have a question that I hope that all the experts that you can help me solve. I have a reading program CAN produce a NOx sensor and display on screen will save as an excel file. I built a second program to control a network of keysight fieldfox A

  • Help! My 8 GB fuze has locked up on me.

    As the title says, my rocket is on and locked.  It surpassed the first splash screen and stopped on the Sansa logo screen and is now stuck there.  I can't do anything.  It won't turn off or go to any other screen.  What should I do?  Any help is appr

  • check sweetims because of the Publisher

    How to download a program that continues to say unknow Publisher

  • BlackBerry Smartphones where do you find a code bar that you have scanned into your phone?

    I scanned a bbm code and it can't locate my phone. Where would I go to find and research the information loaded on this code?