This discussion is archived
4 Replies Latest reply: Feb 13, 2013 2:16 AM by Tauceef RSS

Currency separator "single quote" instead of comma

Tauceef Journeyer
Currently Being Moderated
Hello Everyone,

I have got a requirement to use single quote as the separator in all my currency fields, I tried that by using
replace(to_char(l_ast_cal,'999G999G999G999G990'),',','''')
but its giving error while inserting/updating the data, because " ' " is not a part of number, also getting trouble doing calculations in javascript.

Is there any better way of doing this, such that single quote should come up only at display point of time and will not get into consideration while submission of page or in javascript.


Regards,
Tauceef
  • 1. Re: Currency separator "single quote" creating problem
    928468 Explorer
    Currently Being Moderated
    Hi Tauceef,

    this is horrible, but should work(assuming that your original separator is a comma):
     substr(l_ast_cal,1,instr(l_ast_cal,',')-1)||''''||substr(l_ast_cal,instr(l_ast_cal,',')+1) 
    To calculate/store the value, you could select the value a second time to a hidden value which you use in javascript or to submit.
    Please let me know if this is what you wanted.

    Thanks
    Sandro

    Edited by: sakra on 23.01.2013 05:30
  • 2. Re: Currency separator "single quote" creating problem
    Tauceef Journeyer
    Currently Being Moderated
    Hi,

    I am changing the currency format by using the method given in this post:

    how to change currency format

    and for reconverting the string into number have created a on submit Computation where I have written this(one computation for each item)
    CURRENCY_CONVERSION_PKG.F_TO_NUMBER(:P201_BANKABLE_ASSET_ACTUAL)
    I want a suggestion from all on this,

    I am planning to create a package for doing the above process, one procedure/function for "onload" and one for "on submit".

    but if I write a function which will return me the respective string on load and another for changing the string to number, in this case I have to call these functions for each and every item in my page, if I am having 100 items on a page, I have to call above function 100 times both on load and on submit, its going to take time.

    I have another way of doing this is creating a procedure for both onload and onsubmit processes, where I will do the conversion and assign the values to items using

    "set_session_state" API, in this case I have to write a procedure for each page wherever I am having currency.

    Just want a feedback from experts which one would be better or if anyone have any other better Idea.

    Please share your views.

    Regards,
    Tauceef

    Edited by: Tauceef on Feb 4, 2013 11:49 AM
  • 3. Re: Currency separator "single quote" creating problem
    Tauceef Journeyer
    Currently Being Moderated
    Hello,

    I did it using the package only, and its working fine, didn't see much effect because of this.

    Having one more doubt on How to do this in Reports.

    In Reports we are having Currency fields and also showing the Sum of those fields

    so, if I format the field using to_char(), sum will not come as it will be varchar.

    Currently its displaying as simple number, but want to format it like 10'000'000

    Please share some Idea if anyone worked on scenario like this.

    Regards,
    Tauceef
  • 4. Re: Currency separator "single quote" creating problem
    Tauceef Journeyer
    Currently Being Moderated
    got it resolved by creating a new column for all currency columns with the formatting required, and used them in the HTML Expression of the existing columns.


    Tauceef

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points