XI / PI Format Number issue

Hello,
When I process the value 782.785 through format number 0.00 I'm expecting a value 782.79 but the standard Format number function returns 782.78. Standard function appears to round to a higher digit only if the value is greater than 5 like '.786' to '.79' and not rounds up the value for 5.
What could be done to achieve this functionality? is it possible without a UDF ?
Thanks for your help!
Larry.

Round up and Round down requirements is not fully feasible to implement using standard function. Use this logic in your UDF...
If you declare input as string and return the value also string for the decimal number then below logic
String str = "782.666";
  double d = Double.valueOf(str);
  DecimalFormat de = new DecimalFormat("###.##");
  return (Double.valueOf(de.format(d))).toString();
  Note: if you declared  input as double or float and return the value double then the below logic will work.
double d = 782.666;
DecimalFormat de = new DecimalFormat("###.##");
return  Double.valueOf(de.format(d));
Hope that helps.

Similar Messages

  • Format number not working correctly in XML Publisher Report

    Hi,
    I have requirement to print sum(column1) with number format with commas on the header.
    I tried giving <?format-number:sum(//CURRENT_COST);'99G990D00'?> this formula is sum current cost column and displaying as 140.253.123.00 but i want to display the same as 140,253,123.00
    i even tried <?xdoxslt:xdo_format_number_l(sum(CURRENT_COST),'999G999D99','EN-us')?> but its even giving the same result as  140.253.123.00
    Please let me know if anyone had the same issue.
    Thanks.

    Hi,
    You can't mix the XMLP extended functions (ie anything prefixed with xdofx) with xsl functions (see user guide - Extended SQL and XSL Functions).
    You could look at using the Choose statement or doing a set of IF statements
    ie <?if:CURRENCY='JPY'?>format...<?end if?><?if:CURRENCY...<?end if?>
    If you go with the multiple IF statements you will probably need to use <?if@inlines:CURRENCY='JPY'?> otherwise you will get carriage returns (see IF statements in boilerplate text in the user guide).
    Thanks
    Paul

  • Format Number in XML Publisher

    Hi
    I am developing a RTF template for EXCEL output report. I am trying to format a number value in this report
    <?xdofx:if to_number(QUARTER_QUANTITY) > -1 then QUARTER_QUANTITY end if?>
    in the above line of code how could we format QUARTER_QUANTITY field (i need 9,999, 999 format)
    I have tried both
    format-number:fieldname;’999G999D99’
    format-number(number,format,[decimalformat])
    nothing worked for my.
    Can some one please help me to resolve this issue.
    thanks
    Raj

    Hi Raj,
    Were you able to solve this problem? I am running into the same problem where I want the number to dsiplayed with 2 decimals. When I view the output in Excel format , it cuts off the last zero for eg 18.30 becomes 18.3 If i use any other Output format like HTML trailing 0s are preserved. How do I solve this
    Thanks

  • How to combine format number and if statement?

    Hi,
    I'm using XDO 5.6.1 under apps.
    My issue is to display a number only if it is not equal to zero.
    Otherwise, i need to display it in european mask using format_number function.
    I tried all the condition statements (if, choose) and they work perfectly.
    <?xdofx:if MAR_SUM=0 then '' else MAR_SUM end if?>
    format number works fine too.
    format-number(MAR_SUM,"### ###.00", "Euro")
    But i did not succeeded to combine if and format number
    <?xdofx:if MAR_SUM=0 then '' else format-number(MAR_SUM,"### ###.00", "Euro") end if?>
    The result is always a blank field, even MAR_SUM is not nul.
    I can not use Word format number bacause it do not work with my mask.
    Please help me, .
    Thanks.
    Pierre.

    Thanks a lot Tim,
    It helped me a lot. I'll simplify my tags using those tags.
    I have another issue concerning cell highlight.
    I have two loops in a table and when I insert <?if@row:position() mod 2=1 ?> <xsl:attribute name="background-color" xdofo:ctx="incontext">#DDDDDD</xsl:attribute>, in order to use cells highlight, my subtotals disappear at the end of my loop.
    Could I send you a email with an example, (and how to contact you)?
    Thank again for your response again.
    Regards.
    Pierre

  • How to Format number in RTF template?

    Hi,
    In RTF template i am using Format_number for custom requirement. when i am using below conditon <?format-number(ENTERED_CR,'##,##0.00')?> number is getting formatted if above 1000 only. My requirement is 1). 444 should format like 444.00 2). 444.55 should format like 444.55 only. Can anyone suggest on this ASAP.

    in the next time use BI Publisher forum - BI Publisher
    <?format-number(ENTERED_CR,'##,##0.00')?>it's works for me
    output:
    444    ->  444.00
    444.55 ->  444.55

  • Format-number,decimal not giving desired output for PO Print report XSL-FO

    Hi All,
    My requirement was to get the Unit price in european format which is 10.000,00
    Iam getting it as 10000,00 but the client needs the thousand's seperator.
    if have used the decimal seperator but iam getting the Unit Price value as 'NAN' when i submit it for an international language like Italian or Spanish
    This is what i have done
    set the decimal format
    <xsl:decimal-format name="euro" decimal-separator="," grouping-separator="."/>
    <xsl:value-of select="format-number(UNIT_PRICE, '#.###,####', 'euro')"/>
    This gives the desired output when i select the US language.
    While submitting through the conc request
    If i change the Numeric char to '.,' by clickin on Language settings..It works great
    I have tried to use the replace function but the syntax is not correct
    format-number(replace('UNIT_PRICE',',','.'), '#.###.###.###,####', 'euro')
    Any Help would be greatly appreciated.
    Thanks
    Mirza

    Hi Mirza,
    I'm struggling having the same problem. Have you found any solution?
    Best regards
    Kenneth

  • Format-number doesn't work with XSL and DW preview

    Hi All
    I'm creating XSL files to transform XML into HTML. However,
    the number formatting doesn;t seem to work in Dreamweaver. For
    example, if I specifiy:
    format-number(price,'$###,###.00'), I should get $7596.99. I
    actually get 7596.990000000001 in my Preview (no currency symbol,
    too many decimal places). If I do the same thing in another XSL
    editor (Xseleerator) I get: $7,596.99.
    This is REAL PAIN, as every time I do anything with number
    formatting, I need to open the XML and XSL in another product just
    to check the formattng.
    Can anyone shed any light on this?
    Thnaks
    Mark

    Try to declare the variable out side of the region
    <script> var tp1;</script>
    <div spry region ... >
    tab panel stuff
    <script type="text/javascript">
    tp1 = new Spry.Widget.TabbedPanels("tp1");
    </script>
    </div>

  • Format Number Function

    Hello All,
    I am facing a problem in Message Mapping. In the Arithmatic Category we have used the function Format Number. The Number Format  is 0.0
    Decimal Separator is (BLANK)
    In this case If I input any value say 8 or 8.0 then the output should be 8.0. However, I am getting 8,0(COMMA Separator) as the output. This causes the Mapping to Fail.
    This problem occurs on one landscape where as on the other landscape it works fine and gives the output as expected.
    Can anybody help me on that?? Am I missing anything in configuration or are there some special settings for it??
    Kindly help.
    Regards,
    Rohit K

    Hi
    if you put the decimal separator as blank then it will use the . as a decimal separator.
    and when you use the ny other symbol in the decimal separator then it will use that sysmob as decimal separator.
    so please check in ur format number properties what u ahve given.
    Thanks
    Rinku

  • XSLT transformation format-number into strange characters

    Hi, Experts,
        When I excute following code to translate a string number DEBIT TYPE C(60) into xml, the result has strange characters.
    <xsl:value-of select="format-number(sap:if(string(number(DEBIT))!='NaN',DEBIT,0),'0.0000000000')" />
        If DEBIT is empty, the correct result should be:
    0x3000 0x2E00 (0x3000)*10       = 0.0000000000
        but actually, the result will be following in some cases:
    0x3000 0x2E00 (0x0F77)*10
        in some cases the result will be
    0x3000 0x2E00 (0x2600 0x2300 0x3000 0x3B00)*10
        What I mean in some cases, I ran the same code on different NW system. I also changed the user profile by NW menu System->User Profile->Own Data, the result won't change whether I use American Comma-Dot or European Dot-Comma.
        Can anyone give some advice on the code? Or there is some patch to solve it?
        Thanks and Regards
    Davin
    Edited by: Davin Wang on Jul 17, 2008 3:15 PM

    Hi Davin,
    do chk the condition it is not correct
    <xsl:value-of select="format-number(sap:if(string(number(DEBIT))!='NaN',DEBIT,0),'0.0000000000')" />
    do chk it
    Thanx
    Sampath

  • Format-number not working for me with preview to excel

    Hi,
    I have a report with 8 fields across within a table.
    Each field is formatted in the same way, with format-number like this (there are 8):
    <?format-number:total-year-remaining;’PT999G999D99’?>
    (that's the type-your-own form-field help text in the word template).
    When I preview the PDF, the data looks fine (8 cells shown below):
    .00 (.10) (.10) .00 (.50) (.50) (.60) (.60)
    But when previewing to Excel, there are two problems:
    1. Only the data in the last field (the 8th one) is formatted with the oracle mask:
    (.60)
    But upon closer inspection, there are two blank spaces after the number in that cell, and the value itself is treated like a string, e.g. '(.60) '. In fact if I ask excel to format this cell like a number with currency and two decimal places, in won't do it because of trailing spaces. Its just not a number to excel at that point. Probably the ('s don't help things either.
    2. The data in the first seven fields in excel are numeric, and I can format them in excel as currency, but I wanted XMLP to handle this, not the excel user.
    The bottom line is this: I want both PDF and excel output. I want both forms to have the fomat mask applied correctly. And I want excel to treat each cell as a number. Is this possible?
    Thanks
    Adam

    Anatoli,
    Hello!
    I don't know if my situation is the same as yours, but after a lot of head-scratching, forum searching and template rebuilding, I finally figured out my problem.
    I had one column that no matter what I did kept appearing in Excel as text. I'd format it to Number in Excel and nothing. When trying to sum the column, Excel would not recognize any of the values as numbers. I even did the reformatting on the XML Word template to number, and the currency format that Adam mentions. Still no go. The $ and ',' appeared, but column still formatted as string.
    I just finally noticed Adam's mention of the 2 extra spaces at the end of the numbers and sure enough mine was doing the same thing. Take out the 2 spaces and voila! Number!
    Every time I redid my template in Word (07 and 03), I used the wizard. (Add-ins>Insert>Table>Wizard) walked through the steps, not really changing anything. Then I would preview and the spaces would be there. The column that I was having problems with was the last column of the table, which would get the text 'end G_ASSIGNED_CC' inserted in after the field name - separated by 2 spaces. Once I took out these two spaces, so the column now shows 'COSTend G_ASSIGNED_CC', it worked fine in Excel - all numbers.
    Hope that helps someone out there as I was having a heck of a time finding anything (solutions anyway) on this.
    Thanks,
    Janel

  • XSLT Processor Bug? format-number() on large numbers

    For numbers 100,000,000.00 and higher, I'm getting extra digits and rounding errors.
    How can I use some custom Java code in the XSL stylesheet so the correct value is displayed (i.e. w/o rounding)? I'm getting a value of 100000000.00 and I need to insert the commas. Sometimes the correct value is displayed, other times, additional numbers are appended and the amount is rounded.

    The XSLT processor uses java.text.DecimalFormat under the covers as the XSLT 1.0 specification suggests. I would imagine any problems with format-number() actually boil down to problems with java.text.DecimalFormat.
    You can use Java Extension functions to perform custom Java in your stylesheet.
    See the file .\extfunc.html in the root directory of the XML Parser for Java V2
    distribution.

  • Hide number (or format number) on Oracle Report with Barcode

    Hi al !
    i have done a example about print Barcode on Oracle Report
    with help link :
    [http://download-west.oracle.com/docs/html/B10602_01/orbr_barcode.htm|http://download-west.oracle.com/docs/html/B10602_01/orbr_barcode.htm]
    However
    I want to hide number under Barcode images or Format number !
    Ex:
    |||||||||||||| --> images barcode
    1234567 --> number barcode
    i want : hide : "123456" or format it : "123.456"
    Thanks !

    Hello,
    The Image is generated by the java code in oraclebarcode.jar
    It is possible to "hide" a part of the image by puting an object ("rectangle" for example ) over the part of the image you want to hide.
    Regards

  • Is the XSLT format-number function supported by XMLType.transform()

    I am trying to use the XSLT format-number function in a stylesheet via myXMLType.transform(myXSL) without any luck. For example, <xsl:value-of select="format-number($myNum,'#,###.00')/>. This works ok under the java based XSLT engine.
    Is format-number supported by XML DB?
    I am running 9.2.0.5.
    Cheers
    Anthony

    I have upgraded to 10g and found that this now works.
    Cheers
    Anthony

  • 2 issues - Invalid Serial Number issue & Lightroom 5 Trial vs full version folder hierarchy question

    Hello
    not sure if I should split these two questions...
    1 - Invalid Serial Number issue
    I'm helping out a friend with their large photo collection and they bought Lightroom 5 and received the serial number but when we add this to Lightroom it states that it's invalid - I tried leaving it until the following week (I visit them weekly) and it still refusing the number - when I went into their Adobe account and took a look at downloads the option to download the full version is greyed out (or an x - I'm not sat on their computer right now so can't double check) but it wouldn't allow me to do anything so we just had the trial version.
    anyone know what the issue is - shall I get them to contact Adobe to get them to take a look - I also had issues trying to find a customer support email address lol. (I seem to faffing with lots of websites/software/companies this week so getting a little frazzled!)
    2 - Lightroom 5 Trial vs full version folder hierarchy question
    This question is linked to the above i- I am wondering if the folders in Lightroom are different in the trial version vs the fully paid version.
    I had set up some greeting card templates and contact sheet layouts for my friend and tried to transfer them to her computer but whilst, LR 'sees' the folders it just doesn't acknowledge the templates - I tried it several ways but I've not had that issue before so will that sort itself when I get the serial number fixed?
    Thank you for any help or suggestions - hope you all have a good weekend :-)
    Lenny

    Hi Lenny, the two questions may be related but the trial is actually the same as the full version. I would suggest getting the serial number issue sorted out first. There have been known issues where a paid for product still shows up as a trial.There is not a lot the community can do. You need to contact Adobe directly using the link below. Use the dropdown menu for boxes (1) & (2) to scroll down the list and choose:
    1. Adobe Photoshop Lightroom
    2. Serial number issues or activating my product
    3. Click on the blue button: Still need help? Contact us – then click the button marked “chat now”
    It’s usually possible to start a live chat, if an Adobe agent is free, and often to get the problem fixed right away.
    Click here to get help now Contact Customer Care

  • Serial number issue in STO PGR

    HI
    I am facing serial number issue after doing PGR
    i am into STO process . Oce PGI for outbound delivery is created and then MIGO (PGR) will happen at recveing pant
    issue is after MIGO (PGR) the serial number status must be in AVLB ..but it is still in EDEL  ESTO ...
    The AVLB status must come automatically in the equipment master.

    Hi
    I am doing through PO...we don't have inbound delivery process ... so i do MIGO with reference to PO
    We have equipment master IE01/2.. plant is assigned  after MIGO  reeving plant is getting updated in the equipment master but the serial number status is not getting changed to AVLB.... also the serial number profile is with MMSL procedure.

Maybe you are looking for

  • How to make "Current Review" available in MSS Compensation backend

    Hi We are implementing the MSS Compensation module. We are using a custom function module for the employee selection (set up in backend table V_TWPC_NAV). This function is then called from the java side via an RFC call to HRWPC_GET_NAV_OBJECTS which

  • Recommendations for third party LR3 web gallery software

    I've begun experimenting with the web gallery software in LR3 and have mixed opinions. Does anyone have recommendations/preferences for such. I've played with the SimpleViewer options and with SlideShowPro. Any views on these would be helpful. Or oth

  • Itunes want load music from internet radio

    itunes keeps freezing up and saying i'm not connected to internet

  • Macbook Pro Late 2011 Grey screen

    Hi pals, I have a Macbook Pro Late 2011 since 2012. I've upgraded it to Yosemite, thing that I've to do from scratch because it worked very slow, but that's not the deal here. The other day I started it, and it simply didn't do it. I've tried everyth

  • InDesign CC opening additional document 5 times when working in file

    I am working on converting our alumni magazine into a DPS app. When working in my files (each spread is now slip up and residgned for horizontal and verticle viewing to become articles for the folio) inDesign will then open the original document from