Format functions - Improvement request

Hello all,
I have request for update.
I.e, i have some site that deals with the products, all products have price, discount, quantity and VAT.
I want to all prices be formated like this: 123,298.23
I have to create functions:
function formatNumber(nStr){
nStr = parseFloat(nStr);
nStr = nStr.toFixed(2);
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
function formatVPC(region, lookupFunc)
var nStr = lookupFunc('{dsStavkeNarudzbenice::price}');
return formatNumber(nStr);
And to do this:
{function::formatVPC}
and if i calculate total like price* quantity i have to add new
function formatPrice*Quantity(region, lookupFunc)
var nStr = lookupFunc('{dsStavkeNarudzbenice::jedinicna_cena}');
return formatNumber(nStr);
Why Not {price| formatNumber}?
Something like Smarty formating, with possibility to add params, like {price|formatNumber, ',', "."} - where  i want to use  , for 1000 separator and . for decimal separator?
Then I can use just one function for all project, without creating additional separators.
Creating small math expressions ?
Now, I can not do this:
Total Sum is {price}*{quantity}
Why not:
Total Sum is {eval|'{price}'*'{quantity}'} or some other solution?
Rationale:
It decrease code, it does not inflicts with application logic, it is more usable and readable

Cmon people, support please, i think that this is good idea...

Similar Messages

  • How do I fix the problems with text formating functions in hotmail and other text based sites?

    In a Mailing list provider site it disables the text formating functions, instead only showing a 'loading' message. The functions never appear. In Hotmail the scroll arrows on the right hand side does not work. Sometimes the email toolbar becomes 'grey' and the buttons do not work. When forwarding an email sometimes the email does not show in the new email message.
    == This happened ==
    Every time Firefox opened
    == Firefox was reinstalled March 2010.

    The only possible fix was turning the phone off immediately and burying it in a bag of dry rice for a week at least. That might...just might...have worked.  But you're way beyond that and I see no fixes.  In fact the phone is probably going to get more problems before finally gving up the ghost.  Continued use is just shorting out more and more of the circuitry.  For that reason I don't think repair is much of an option. Go to an Apple Store and buy an out-of-warranty replacement.

  • FORMAT function in SQL

    Can I use FORMAT function in SQL statement?
    If not, how to do it?
    Here is the SQL that I want to do.
       SELECT last_name, first_name, FORMAT(birth_date, 'mm/dd/yyyy') FROM customer

    Hi,
    To display the result as mm/dd/yyyy, you can use the code like below:
    DECLARE @d DATETIME = '10/01/2011';
    select FORMAT(@d,'d','en-US'  )
    To display the result as yyyymmdd, use CONVERT:
    DECLARE @d DATETIME = '10/01/2011'
    SELECT convert(varchar, @d, 112)
    Reference:
    http://www.sqlusa.com/bestpractices2005/centurydateformat/
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Getting a "Business partner not found with partner function type requester"

    Hi There,
    After I add a text item to the shopping cart using the SHOP t-code, I get a message "Business partner not found with partner function type requester" What could be causing this and how can I rectify this problem.
    Please help mas this is an urgent issue.
    Thanks,
    Grace

    Hi Grace,
    First check :
    1- transaction : CRM_OM_BP_INTEGRATE
    select org structure where your user is and check that you have green lights (no missing address....)
    2- Run transaction USERS_GEN
    Select check user
    Is everything correct or does the user need to be repaired ?
    Kind regards,
    Yann

  • Pad leading zeros in a string.Format function

    How could use the string.Format function and in the format text pad a leading zero? 
    Pseudo code is:
    string parm = “5”;
    string format = “Some number formatted as 3 dig: Format({0}, 000)”;
    string output = string.Format(format, parm);
    Where the output would look like this:
    “Some number formatted as 3 dig: 005”
    Thanks.

    Thanks everyone. Unfortuantly there's a constraint where the padding operation needs to be embedded in the format string. This entire operatin is being put together dynamically where the format strings are being pulled from a library of format strings stored
    in a database. at runtime we don't know how which format will be used and how many parameters will be passed in. we have logic to handle the unknown number of paramters as there is metadata which helps us with that.
    the need for leading zeros needs to be part of the overall format defined in the format string.  for example, a real format string stored in the database looks like this:
    "LINE_NO = '{0}',  AND GEO_LOCATION = 'T{1}, {2},  R{3}, {4}, , Sec. {5}'"
    and its output from the string.Function is:
    "LINE_NO = 'TG-G2469',  AND GEO_LOCATION = 'T155, N,  R93, W, , Sec. 5'"
    the last parameter (param 5) had a value of 5.  In another case the output requirement might need to look like this:
    "LINE_NO = 'TG-G2469',  AND GEO_LOCATION = 'T155, N,  R93, W, , Sec. 05'"
    note the "05" at the end...
    the logic of using the leading zero needs to be embedded in the overall format string text.
    Thank you.

  • Format functions.....

    Hi,
    I have detected something strange.....
    There are 2 different kind methods how i can write a format function:
    1. <?format-number:1234;'SOMESTRING'?>
    2. <?format-number(1234,'SOMESTRING')?>
    If i use the first kind the output format is sometimes wrong.
    example: <?format-number:1123.45565643;'0.00'?> should be: 1.123,45 in german and 1,123.45 in english local. But sometimes the result is: 1123,45565643 and nothing changed. (I think its some kind of error if I am combinating the sum() function)
    And if i use the second kind the output format is sometimes wrong. everything works fine. But the reportlocal of my client Page has no influence to the output and doesnt effect the seperators...
    I hope that helps to fix a bug.
    Or is it no bug?
    Greetings....

    no solution here?

  • Where to submit DPM feature improvement requests?

    Where's the best place to submit DPM product "improvement" requests to Microsoft for their consideration?

    Hi Mike,
    Please accept the following feedback:
    When DPM writes SQL databases from replica to tape, it rewinds the tape after every database, causing needless wear on the tape and tape drive.  Today DPM is writing SQL databases to the end of a tape (at approx. the 2TB mark on an LTO5 tape),
    and it's taking over 10 minutes of tape travel time for a 5MB database, then another 13 minutes for the next 4MB database.  In the last three hours it's written 16 databases, taking over 10 minutes each time, their total size is less than 90GB,
    and DPM rewound the tape after every database. 
    Please review the tape handling to ensure needless tape rewinding does not occur. We want SQL (and other) tape backups to stream data to the drive continuously until the tape is full.

  • Format function in Link Inspector

    Hi,
    May i know that how to fully utilize the Format function in the Link Inspector?I even unable to click on those format...mind to share the tips?!
    Thanks

    First that link format does not work for the navbar. It only works on text based links you add to the page. Once you've set up the URL in the Link pane you can go to the format pane and set the link, rollover, visited and disables formats. But you have to have the text link selected first. Thisdemo page may shed some light on it.
    OT

  • Functional improvement of setting of item of UI-AP

    Hi:
    I would like you to improve the function of the setting of the item of UI-API.
    The phenomenon is as follows.
    1. When the estimate slip (order and purchase order, etc.) is added or is updated, items as follows are acquired, and after it edits it, set from the screen again.
      Item 1: Amount
      Item 2: Unit price
      Item 3: Delivery date
      Item 4: Commission rate
    2. The value is acquired as the cursor moving in the order of the following, and after it edits it, it is set again.
      (The cursor moves to each item though the reason is not understood. )
          Amount > unit price > fixed time of delivery > commission rate
    3. It takes time until it becomes possible for the user to operate because a cursor movement above-mentioned 2 is slow on an online screen.
      It increases with this cursor for about one second every an item.
    << Client specs when executing it >>
         CPU Intel Core(TM2) when measuring it Duo 1GHz
         RAM 1GB
    As for the item setting processing, because the cursor movements only of the same number are generated when the edited number of items is ten items, is 20 items, and increases, the delay is expected in proportion to the number of items.
    I hope the functional improvement of the item setting with UI-API.
    Operation where the cursor moves to acquisition and a set item is lost.

    In addition, the scroll bar is unable to be used by anyone using a left handed mouse option.

  • Format for output request

    Hi Experts,
    When I printed the output to create a output request in SP02, the format turned to be X_paper auto and I have to change it every time. how to change the format to X_65_132 automatically? where can I set the parameters?
    Thanks very much.
    Nadali

    Hi,
    Use function module 'SET_PRINT_PARAMETERS'
    and Layout = 'X_65_132'
    Edited by: Anil Mane on Sep 8, 2008 2:36 PM

  • EWB 10+ Improvement Request

    Well, since some time now I whish EWB 10+ would offer a more advanced component search capability. As a user, I like to be able to narrow a search let's say of a
    diode, within the diode database that can handle let's say a reverse bias of 1000V. Or in the same scenario, I like to find a NPN Transistor that can handle 2A at 50V
    and/or 200W for example....
    Listing all these part numbers in the Database is great, provided one knows them all. I certainly have not the time all day long to digg through datasheets of these listed
    PN's to eventually come accross a component I could use in my design.
    Just a 'limited' text search does not cut it !!!! We have the year beyond 2000, so please let's make use of the computing technology not only for the actual simulation but
    also for user friendlyness. I hate to do manual and dumb search tasks.
    MS Windows provides way more than needed for that.
    So far version 10 is a great imporovement over all the other versions, keep improving it while maintaining ease of use and the same user interface. Keep adding parts
    and models to the database (And please verify them before release). Improve the Model Wizard, to make it easy to create a new component from scratch. Make it easy
    to share newly created parts and models with the EWB community by adding a model export function.
    Thanks for the consideration

    Hi KCT,
    Thanks for your comments and suggestion.  I will put your suggestion about the database search into the feature request list. 
    Just a note about sharing components.  If you place a component on the work space and send the file to someone, when they open your file and double click on the component there should be an option to save it to their database.
    If you have the Power Pro version you can also select ToolsàDatabaseàDatabase ManageràComponent, when you highlight a component or several components, click on the Export button and Multisim will create a .prz file. When the other person double clicks on this file, it will save the components to their database.
    In Ultiboard, you can click on the footprint and select ToolsàDatabaseàAdd selection to database.  If the board has several footprints that is not in your database, select ToolsàDatabase àDatabase Manage, on the Database column click on the + icon with the arrow pointing to the lower right, you should get a pop up with all footprint in the design file.  Put a check beside the footprint you want in your database and click O.K.
    Tien P.
    National Instruments

  • Formatting function for columns which store japanese characters

    I have a table which stores names in all languages.I have a SQL Report.When the names are in English the formatting is good.But when the names are in Japanese.The formatting is going wrong.
    A part of SQL report is as follows
    COLUMN emp_name formata20
    COLUMN mgr_name formata20
    select emp_name,mgr_name
    from employee;
    The data in the columns are coming in ZigZag fashions.I tried using ltrim and rtrim but had no impact.Are there any functions which would help in formatting the query.I need this very urgently.
    Thanks in advance

    Change your environment variable 'nls_lang' appropriately to reflect the language.
    For example on my computer, this variable has the value
    American_America.WE8ISO8859P1
    Typically NLS_LANG environment variable is of type:
    language_territory.charset
    If you are using Japanese character set, you could specify the environment variable as:
    JAPANESE_JAPAN.JA16EUC
    Please go through Oracle's Globalization Support Guide for additional information.

  • Date format in meeting request responses appears to be hardcoded to US format

    Hi
    When a room mailbox declines a meeting request that exceeds the booking window in days a response like this is returned.
    The end date of this series of repeating meetings is too far in the future. This resource can only be scheduled up to 180 days in advance. The end date
    must be before 2/7/2011.
    The date returned appears to be hardcoded in US format (M/d/yyyy). I need this to be NZ date format (d/MM/yyyy). How can I accomplish this?
    Thanks
    Olli

    FWIW, we are also having the same problem despite the room being set to the correct regional settings.  Our environment is Exchange 2010 SP2
     [PS] C:>get-mailboxregionalconfiguration  MeetingRoom | select *
     RunspaceId                            : 1657394a-5640-4d8b-9b3b-e061e03db69f
     DateFormat                            : d/MM/yyyy
     Language                              : en-AU
     DefaultFolderNameMatchingUserLanguage : False
     TimeFormat                            : h:mm tt
     TimeZone                              : AUS Eastern Standard Time
     Identity                              :
     IsValid                               : True
    The Declined message reads:
     Your meeting request was declined.
     The end date of this series of repeating meetings is too far in the future. This resource can only be scheduled up to 500 days in advance. The end date must be before 11/17/2013.
     All times listed are in the following time zone: Customized Time Zone
    I guess, given the lack of response from MS, that it is in fact hard coded and cannot be changed. C'mon MS, can you atleast confirm this is the case?
    Thanks guys
    Mick

  • Date Format in Leave Request

    Hi All,
    We are using ESS on Portal, with EHp3. In leave request we want to change the date format (From Date and To Date) from MMDDYYYY to DDMMYYYY.
    In back-end we are maitaining the date format as DDMMYYYY for the R3 User. Dont know where we maintain these settings in portal.
    Please help to solve this

    Hi Sravanthi,
    Too late to answer but, i have also faced this issue.
    1) Change the Language at Portal User Administration (Language to UK-English)
    2) Change the language at System Administration --> System Configuration (Language to UK-English)
    3) Change the language at Visual Admin (Language Properties)
    4) Change the Language at IE Explorer Tools -->InternetOptions --> General Data tab --> Languages button --> (Language to UK-English)
    5) In the server there is a property file where the language properties are maintained. You can change that as well.
    6) Write a Java program which collects all the users and  change the language using coding by using API
    7) Change the Language at R/3 SUO1 Screen.
    Out of all these techiniques every step has its advantages and disadvantages, I prefer Step1 is a better choice.
    Please let me know what solution you have followed so that i too follow the same

  • How to open Report output in RTF format using concurrent request form.

    Hi
    I have created a report using BI publisher and RTF format. This report is working fine in PDF format. User can submit report using consurrent request form and can see report preview in PDF format.
    Now user wants to submit another request and wants to see report output in RTF format.
    User submitted a request, request successfully completed and generated a output RTF file in unix box but when user wants to see report output using concurrent request form (View Output) then window is showing raw data instead of RTF output.
    Can any body tell me about solutions?
    Thanks
    Ravi

    Hi Ravi
    I did little R&D on it and found following 2 solutions.I am sure that you also find something but for my shake i am putting it here.If you already find the solution then ignore it.
    I) 1st Solution
    1)Change the profiles 'Viewer: Application for Text' and put value as 'Browser'
    2) Change the profiles 'Viewer: Text' and put value as 'Browser'.Either change it system level or concerned user.
    3) Log out from Current session and close all internet explorer application.
    4) Log in again to check the result
    II) 2nd Solution
    1) Navigate to: Sys admin --> Install -> Viewer Options to open the Form "Viewer Options".
    Do the entry as shown below:
    File_Format     Mime Type               Description
    RTF          application/rtf Microsoft Word(.rtf)
    RTF          application/msword          Microsoft Word(.rtf)     
    2) Then ensure that the profile option Viewer: Application for Text is set to BLANK at the Site Level and User Level.
    3) Then ensure that the profile option Viewer: Text is set to 'browser' at the Site Level.
    -- It will pop-up the screen to choose application name from above two values.
    Hope this will work it for you. For me i replicated the scenario and both solutions were working for me.
    With Best Regards
    Darshan Bhavsar

Maybe you are looking for

  • Camera Raw - saving photos- help!

    I edit my photos in camera raw, and after clicking "done", I save my photos in another folder on my computer. This has never been a problem until recently. When I go to that folder to open the photo, the photo is somewhat blurry, grainy, and the colo

  • Autofill form with database data

    I'm trying to create a form that when the page loads, will           automatically fill with data according to the parameters specified in           the url. I then want to be able to change fields within the form, and           submit it, saving the

  • Oracle.jbo.InvalidDefNameException: JBO-25004: Definition name WEB-INF.lib.

    Error 500--Internal Server Error oracle.jbo.InvalidDefNameException: JBO-25004: Definition name WEB-INF.lib.classes.adfmsrc.sanyc.view.DataBindings for type Package is invalid      at oracle.jbo.mom.DefinitionManager.loadProjectDefinition(DefinitionM

  • BTE F110 Edit Proposal

    Guys, I found the BTE 00002105 for the creation of the proposal in t-code F110. But the same BTE doesn't work for the Edit Proposal. I will need a BTE for editig the proposal (when clicking on the save button). Dou you know if there's any? Thanks!

  • New Window, HTMLLoader.loadString image problem

    Hello, I woudl like to load an image into a new window which I create, the image is accessable via the main application e.g. app:/images/notificationbg.png After creating the new window, the text and everything appears fine, but the image fails to lo