digital format mask

Hi all
I don't understand why the following query:

Select double to_char(030.40,'09999D999')

return

00030,400

that is 10 characters long, in the format mask there is 7 times the number 9, then the width must be of 7 + 1 (the sign) and not 10 fetch!

Thank you
Francesco
Italy

Hi, Francesco,.

francy77 wrote:
Hi all
I don't understand why the following query:

Select double to_char(030.40,'09999D999')

return

00030,400

that is 10 characters long, in the format mask there is 7 times the number 9, then the width must be of 7 + 1 (the sign) and not 10 fetch!

Yes, the 2nd argument of TO_CHAR has 7 ' 9 and 1 would. " It also has a '0', which causes the release of 0 to this polint. To_char leaves room for a first sign, also, makes 7 + 1 + 1 + 1 = 10.

Use "FM" in the format string to change wheher or not, you get unnecessary spaces (including the sign and the end corresponding decimal placess to '. 99').
It's

TO_CHAR (30.40000, 'FM09999D99')

Returns a string of 7 characters

00030.4

Do experiments with different numbers (including negative numbers), different combinations of '0' and '9' and 'FM', to understand how works the bettere TO_CHAR. (Of course, you're already readiing language SQL. Manual, so I don't need to remind you that, or to send a link, such as)
http://download.Oracle.com/docs/CD/B28359_01/server.111/b28286/sql_elements004.htm#sthref376
)

Published by: Frank Kulash, December 15, 2010 08:44
Added a note on the FM

Tags: Database

Similar Questions

  • groups of digital format mask separator

    Hello
    can someone explain to me why the following Charly works well:

    SELECT THE DOUBLE TO_CHAR(1890.55,'$99G999D00')

    and it is not:

    SELECT THE DOUBLE TO_CHAR(1890.55,'$99G999D00')

    the only difference is that in the first, there is the G symbol to specify the groups and in the second separator, a comma (,) to indicate the group separator.


    If I run the following:
    Select * from nls_session_parameters
    NLS_NUMERIC_CHARACTERS is.

    Thank you
    Francesco
    SQL> SELECT TO_CHAR(1890.55,'$99G999D00') FROM DUAL;
    
    TO_CHAR(189
    -----------
      $1.890,55
    
    1 row selected.
    
    SQL> SELECT TO_CHAR(1890.55,'$99,999D00') FROM DUAL;
    SELECT TO_CHAR(1890.55,'$99,999D00') FROM DUAL
                           *
    ERROR at line 1:
    ORA-01481: invalid number format model
    
    SQL> SELECT TO_CHAR(1890.55,'$99,999.00') FROM DUAL;
    
    TO_CHAR(189
    -----------
      $1,890.55
    
    1 row selected.
    

    Do not use G with '.' (or D with ',')

  • Digital Format on column displayed as a Popup LOV mask

    APEX 4.2 using theme 24.  In a tabular presentation, I have a column that is defined in the table as number 4 and I display as a Popup LOV.  I want to display on the initial load data form left padded with zeros - 0000 format mask. The Popup LOV gray on the ability to set the format mask. If I change it to a text field I can define the mask and display it as I want. I need to allow users to choose one of the LOV based on another table where the column is defined as a character. When the value is selected in the LOV it appears with the full left 4 digits padded with leading zeros, which is what I want.  However as I said on the initial load of data the leading zeros are not displayed.  It's really just a matter of Visual for the users, it is part of a GL account number and users are accustomed to seeing the full figures as if it was the character.  And please do not suggest I change the column in the table of characters too much process on the side server use it as a number.

    Thanks for the feasible suggestions!

    Therese

    Theresas wrote:

    APEX 4.2 using theme 24.  In a tabular presentation, I have a column that is defined in the table as number 4 and I display as a Popup LOV.  I want to display on the initial load data form left padded with zeros - 0000 format mask. The Popup LOV gray on the ability to set the format mask. If I change it to a text field I can define the mask and display it as I want. I need to allow users to choose one of the LOV based on another table where the column is defined as a character. When the value is selected in the LOV it appears with the full left 4 digits padded with leading zeros, which is what I want.  However as I said on the initial load of data the leading zeros are not displayed.  It's really just a matter of Visual for the users, it is part of a GL account number and users are accustomed to seeing the full figures as if it was the character.  And please do not suggest I change the column in the table of characters too much process on the side server use it as a number.

    Simply select it in the source region like query:

    ...
    to_char(col, 'fm0000') col_alias
    ...
    
  • property of format to the digital field mask

    Hi all. I'm on devsuite 10g.
    I have a little problem with the format of a numeric field mask property.

    I want to display like this:

    3,000,000,000

    But in the format mask property if I put the 9G999G999G990 I got this result:
    3 000 000 000

    I read that I should change the parameter NLS_LANGUAGE but surely, there would be problems with the other columns in the database, such as the columns date, ecc.

    How can apply a mask to format my field to see 3,000,000,000?

    Thank you all for collaboration,
    Fabrizio

    Oh, sorry; You must add it without the quotes:

    NLS_NUMERIC_CHARACTERS=,.
    

    see you soon

  • validation of digital data with a format mask

    Hello

    I have the following situation:

    field 'Amount' COMP (11.0) in a table.
    a form for this amount with a p8_amount parameter and a format mask. for example 1234 becomes 1,234.

    I entered a large amount of data.

    Now, I want to build a validation.
    But I get an error of conversion (character number) takes the apex the field amount 1234 makes 1.234
    and that's why I no longer use to_number (causing the conversion error).

    How to convert the parameter to a number?

    Any response will be appreciated.

    Thanks in advance.

    Leoa

    Hello

    TO_NUMBER (String) may have problems if there is non-numeric characters, however, you can apply a format string so that it can be used in the conversion:

    TO_NUMBER(string, '9G999')
    

    Andy

  • Workspace: unregistered control/indicator Digital Format

    Hello

    Using VS 2013, I'm not able to maintain the digital format of a digital medium.

    • Open and run the project delay example of Sinewave

    • On the workspace, do a right-click on a digital indicator to open the dialog box change point

    • Go to the tab Format & accuracy, Format has a value other than Decimal (engineering here) click OK.

    • Save (File' Save) and leave the workspace

    • Run the project again

    • On the workspace, do a right-click on a digital indicator to open the dialog box change point

    • Go to the tab Format & accuracy: Format value is decimal (and not the previously defined value)

    I do not think it is the expected (also tested with VS2012) behavior. This applies also to controls.

    I did something wrong? Is this a bug? Am I the only one having this problem?

    Best regards

    Matheiu Hey,.

    It is certainly a bug. It shouldn't work like this.

    We have the question followed internally as CAR #449833. Keep an eye on this number in the section of the fixed a Bug of version of the fix to come/releases readme (similar to this). We should hopefully get it sent soon!

  • [REQUEST] Automatically display the number with the format mask

    Hi Expert,

    I use Jdeveloper 11.1.1.6.0.

    I have a problem to display the input text that automatically uses the format mask user input, as for example the entered user 10000 then the field will automatically display of 10,000

    Is this possible to do?


    I already find but I just had to format mask that the user must input 10 000 not automatically display in format.


    Please your advice, really appreciate your help.


    Thank you

    I already find but I just had to format mask that the user must input 10 000 not automatically display in format.

    Can you describe your use case a little more?

    The format is applied only when the focus is moved out of the field.

    You want to display the groups directly separator when the user inserts the value in the field?

    In this case, you will need to use javascript, and format the entry after each character. This technique is described in the blog of Frank https://blogs.oracle.com/jdevotnharvest/entry/get_social_security_numbers_right

    Timo

  • Format mask of Crete then we enter some numbers in the text field

    Hello

    Version: Oracle Apex 5.0

    I'm trying to format mask using dynamic action. As if you enter 6 digit values in the text field, it must be auto filled with sign.i.e «-» 333 333

    Created:

    Dynamic action:

    event: key to exit

    Article: xxx

    JavaScript: $v('xxx').replace(^[[:digit:]]{3}-[[:digit:]]{3}$)

    When: touch button

    It does not any help would be great.

    Followed stops:

    Re: How to make a format for the input mask?

    Hi Pranav.shah,

    Pranav.Shah wrote:

    Version: Oracle Apex 5.0

    I'm trying to format mask using dynamic action. As if you enter 6 digit values in the text field, it must be auto filled with sign.i.e «-» 333 333

    Created:

    Dynamic action:

    event: out of key

    Article: xxx

    JavaScript: $v('xxx').replace(^[[:digit:]]{3}-[[:digit:]]{3}$)

    When: touch button

    It does not any help would be great.

    Followed stops:

    Re: How to make a format for the input mask?

    Use instead the input mask text "Text hidden v5.0" plug-in for Oracle APEX 5.0.

    Reference: Oracle Application Express Plug-Ins

    Kind regards

    Kiran

  • Best way to apply the Format mask for the fields in a Table of the ADF

    Hi all

    12.1.3 JDev

    I would like to introduce the price data, quantity etc. fields of the ADF Table of the user interface in a specific format.

    These formats need to be dynamic, because they change according to the locale selected and sometimes they differ in the same locale.

    I tried approach converter custom but not satisfied because it is called several times when it is used in a table of the ADF and when asked that told me that this is the behavior.

    Custom converter of an attribute in a table called several times

    So, please suggest a better way to apply the format mask (which has min & max fractions, grouping, rounding) to the fields in the Table of the ADF.

    Please let me know if you need more information.

    Thank you

    B S Bilodeau.

    The second question, which I've mentioned here is the converter is called several times for each click on the table.

    This isn't a problem, this is the expected behavior (and you can't avoid it).

    Dario

  • I have seconds in digital format, I need to convert this number to format MI: SS

    Hi all

    I have seconds in digital format, I need to convert this number to format MI: SS

    ex SEC 119-> 01:59 you guys can help me?

    s 900-> 15:00

    can you help me?

    Thank you all.

    Hello

    Here's one way:

    SELECT TO_CHAR (TO_DATE (119 ' SSSSS'), 'MI: SS') FROM DUAL;

    SQL > SELECT TO_CHAR (TO_DATE (119 ' SSSSS'), 'MI: SS') FROM DUAL;

    TO_CHAR (TO_DATE(119,'SSSSS'),')

    ------------------------------

    01:59

    SQL >

  • Download Apex 4.2 - blob in report with the Format mask

    Hello

    I need a little help.

    I have a report like this:

    SELECT id, file_name, dbms_lob.getlength (blob_content)

    of blob_docs;

    The column with the dbms_lob, is defined by the format mask, as a download link, saving up the BLOB to the user of the computer.

    My problem is a bit silly, I don't want to see 'Download', but the file name of each record, such as the 'link text'... but I can't seem to achieve this goal.

    My format mask looks like:

    DOWNLOAD: BLOB_DOCS:BLOB_CONTENT:ID:MIMETYPE:FILE_NAME:LAST_UPDATE:CHARSET:Attachment: download

    I tried to use #FILE_NAME # in the field 'Text download', since it is one of the column names, but nothing helped.

    Also used & FILE_NAME. but obviously does not work and gets the text "Download".

    All I want is a report that looks like

    File1

    File2

    File3

    Instead of

    Download file1

    Download File2

    Download file3

    Does anyone know how to get there?

    Thank you!!

    jaydarp wrote:

    I need a little help.

    I have a report like this:

    SELECT id, file_name, dbms_lob.getlength (blob_content)

    of blob_docs;

    The column with the dbms_lob, is defined by the format mask, as a download link, saving up the BLOB to the user of the computer.

    My problem is a bit silly, I don't want to see 'Download', but the file name of each record, such as the 'link text'... but I can't seem to achieve this goal.

    My format mask looks like:

    DOWNLOAD: BLOB_DOCS:BLOB_CONTENT:ID:MIMETYPE:FILE_NAME:LAST_UPDATE:CHARSET:Attachment: download

    I tried to use #FILE_NAME # in the field 'Text download', since it is one of the column names, but nothing helped.

    Also used & FILE_NAME. but obviously does not work and gets the text "Download".

    All I want is a report that looks like

    File1

    File2

    File3

    Instead of

    Download of file1

    Download File2

    File3 download

    Unfortunately (and annoying), it doesn't seem possible to do using the declarative format BLOB mask. Instead, a personalized download link should be generated in the report query using the apex_util.get_blob_file_src method of the API.

  • Format mask number in the XML editor reports

    Hi all

    I have a requirement in the format mask in xml publisher reports.

    I have a field in my report that the quantity,

    1 > if the value is 1234 I need to show as 1 234

    2 > if the value 1234.56 I need to show 1,234.56

    so I tried with properties of form with number format mask ' #, # 0.00' decimal so that's good, but for like number for 1234 also he 1,234.00 impression so I need 1 234, how I can do this, please help me.

    Thank you

    Thank you Deb to clarify. Yes just check the decimal (.) will work.

    I tried with my example of xml data, and it worked.

    Try this now...

  • 4.2 blob format mask download works not

    I use Apex 4.2

    I worked through the book beginning Oracle Application Express 4. In Chapter 6 the BLOB is added to a report.

    I pasted the code example in the report definition (though with my own page numbers):

    SELECT

    'TICKET_DETAILS '. "" TICKET_DETAILS_ID ""TICKET_DETAILS_ID"

    'TICKET_DETAILS '. "" TICKET_ID ""TICKET_ID. "

    'TICKET_DETAILS '. "" "DETAILS",

    'TICKET_DETAILS '. "" CREATED_ON ""CREATED_ON"

    'TICKET_DETAILS '. "' CREATED_BY ' 'CREATED_BY."

    DBMS_LOB. GetLength ("Attachment") SETTING

    Of

    'TICKET_DETAILS '.

    WHERE (("TICKET_DETAILS". "TICKET_ID" (=: P5_TICKET_ID)) "

    I go to the report attributes and click on the attachment column.  I enter the suggested format mask

    DOWNLOAD: TICKET_DETAILS:ATTACHMENT:TICKET_DETAILS_ID:MIME_TYPE:FILE_NAME:inline:Download.

    When I press on apply I get:

    1 error has occurred

    "" not found. (Go to the error)

    I've confirmed that the query runs and P5_TICKET_ID are on page 5.

    Do not understand what it meant, I've been tracking this page

    17.10 on the BLOB Support in forms and reports

    and the section "Providing a download link" seems to confirm that the above format is correct.

    Pointers would be greatly appreciated.

    I also did the exercises in the book, and it worked for me.

    Your format mask is correct. But before pressing submit you must also enter the blob column attributes:

    Format of mask (required value): DOWNLOAD

    * Table (required value) of blob: TICKET_DETAILS

    * (Required value) column of blob: attachment

    * Primary key column 1 (required): TICKET_DETAILS_ID

    Primary key column 2:

    Mimetype column: MIME_TYPE

    Column of file name: filename

    Last update column

    Character set column:

    The content disposition: attachment

    Download text: download

    You may have forgotten who?

  • How to make the custom format mask?

    Hi all
    I work in the application using Islamic Dates (ex: 01/01/1434).
    the data stored in the following format (ex: 01011434).
    to display the data I did the method java to format then in viewRowImpl, then pass the getAttributeInternal to the method

    public static String formatHijriDate (String val)
    *{*
    Try
    *{*
    Return val.substring(6,8)+"/"+val.substring(4,6) + ' / ' + val.substring (0.4);
    *}*
    catch (Exception ex)
    *{*
    Return "";
    *}*
    *}*
    ----------
    is there a way to make the declarative custom format mask to easy my task to put in shape Hijri dates?

    I recommend you use a converter instead (http://docs.oracle.com/cd/E25178_01/web.1111/b31973/af_validate.htm#BABGIEDH). You just need to apply methods...

    Timo

  • Why my cadratins split into two quadratins only in digital format (ebook)?  How to stop this?

    I work for a Publisher and we use InDesign to implement our print files can be downloaded (usually in PDF format).

    Then, I create a new file for ebooks, remove pages additional, marking the table of entries contained as hyperlinks, etc. internal.

    Given that the Kindle plugin is still in beta and cannot, for some reason, recognize a table of contents created using hypertext links (even if that's what specify instructions), I convert it to an ePub, check, make all necessary revisions, except that as the upload of ePub.

    Can I convert the ePub in mobi using Calibre.

    In both cases, my cadratins are divided into two quadratins in digital versions.  I use the low InDesign Type menu to select the em dash and it appears as a single symbol or glyph.  Print file seems perfect.  It is only when it is converted to a digital format that the em dash is divided into aligned format.

    I need to find a glyph special to use does not appear in my font (Times New Roman)?  I really need to fix this!  Any help is appreciated.

    Hello

    Thanks for sharing files. In the "OutpassageEbookTextcontent.indd" document, instead of an em dash, two quadratins are used and it is probably the reason why you see in the EPUB. You can use the find/change dialog box to understand when these are used. I sent an email stating in many places where they are used as your files may be confidential and I abstained from publishing excerpts of text on the forum. Please take a look and let me know if I have not understood your problem.

    Kind regards

    POOJA

    InDesign engineering

Maybe you are looking for