Format decimal numbers in BI publisher RTF template - bi-publisher

How to format decimal numbers in BI publisher RTF template
I have XML tag UNIT_PRICE with value .25 , In the report output it displays as 0n25 instead of 0.25
The attached picture is here. It has to be 0.25 instead of 0n25

It worked after formatting the number as below
Note : https://docs.oracle.com/middleware/bi12214/bip/BIPRD/GUID-E2904A42-80A1-4086-8A8C-31FDE24389C1.htm#BIPRD3160

Related

How to format decimal places in Aspose.Word Template?

I want all numerical data to be formatted with 2 decimal places.
Is there a way to set this in the template word file (where I output the variable value via
<<[variableName] >>
), or even globally?
To format a numeric expression result, you can specify a format string as an element of the corresponding expression tag.
<<[variableName]:"0.##">>
See the following article for more information:
https://docs.aspose.com/words/net/outputting-expression-results/

Whole text not exported in pdf using aspose word template

I have a scenatio to export a 25000 characters text , which is does not have any space break between character. it mean single word with 250000 length . but realtime a word length cannot be more then 25. Anyhow the text should have exported into pdf using Aspose word template. but it doesnot export 25000 length , instead export 4578 characters into pdf , remaining are discarded in pdf. but i could get the 25000 length character in my code before calling that pdf export method using aspose.
But the text are properly exported into pdf , if you give positive scenario text upto any characters length .
Let me know, is there any solution why the text are discarded , if gives contineous text without break?
Please use CompatibilityOptions.GrowAutofit property as shown below to get the desired output.
Document doc = new Document(MyDir + "SupervisionReportTemplate - Copy.docx");
DataTable table = new DataTable("SupervisorComment");
table.Columns.Add("GeneralVisitComment", typeof(string));
var newRow = table.NewRow();
newRow["GeneralVisitComment"] = File.ReadAllText(MyDir + "25000 contineous character length.txt", Encoding.Unicode);
table.Rows.Add(newRow);
doc.MailMerge.ExecuteWithRegions(table);
doc.CompatibilityOptions.GrowAutofit = true;
doc.Save(MyDir + "18.4.docx");
I work with Aspose as Developer Evangelist.

Currency format is excelJS

How do you format currency in exceljs?
All I've found is this from their docs...which I have no clue how to type so I pasted it, but it doesn't seem to work
// Set Column 3 to Currency Format
ws.getColumn(3).numFmt = '�#,##0;[Red]-�#,##0';
Just took a little bit of tinkering with.
ws.getColumn(3).numFmt = '$#,##0.00;[Red]-$#,##0.00';
The #'s are optional digits. If you don't care about negative numbers being red you can leave it as $#,##0.00
For the full Accounting format, eg left-justified '$', $- for $0.00, etc, you can use:
const numFmtStr = '_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(#_)';
cell.numFmt = numFmtStr;
see: What are .NumberFormat Options In Excel VBA?

How to concatenate NSNumbers and keep the locale format?

I'm building a calculator like. Every time I press one of the number buttons of the calculator, I would like to have the label displaying the input, to concatenate the new input to the display.
Let's say I press 1 then 2 then 5 and the label displays 125. So far I was converting each number into a string and was appending them one after one. But I would like to make it "localized". So that if the locale is US, for 1,256.43 it display 1,256.43. If the locale is FR, it displays 1 256,43.
For that I was doing the same than before but to convert the number to string I was using a NSNumberFormatter. The problem is when I get the string 1 256 and I convert it into double (to then use the formatter) with NSString(string: "1 256").doubleValue I get 1 and not 1 256
What do I do wrong?

Proper way to display the result of large calculations?

When performing calculations on large numbers, how does one properly output the result in the right String format for the end user to see? I've tried the different format specifiers for NSString and compared the results to what the iOS Calculator app shows and some of the results aren't the same. Ideally it would match the iOS Calculator results exactly.
I know it needs to be displayed in decimal format until the number is sufficiently large, and at that point it needs to be shown in scientific notation. Therefore I thought %g was the right specifier. But it doesn't match the built-in calculator for the same calculation.
[NSString stringWithFormat:#"%g", calcResult] //where calcResult is a double
Some examples:
123456.7 * 1 should display as 123456.7 but it is displayed as 123457 (puzzling!)
123456789 * 1 should display as 123456789 but it's displayed as 1.23457e+08
123456789 * 123456789 should display as 1.524158e+16 but it's displayed as 1.52416e+16
Also, how does one get the comma (or period depending on locale) to appear in the result? Are there additional specifiers one can use to get the exact format the iOS Calculator shows?

Resources