Use-Case of Back tick(`) in number format.

Use-Case of Back tick(`) in number format.

book

Article ID: KB0070996

calendar_today

Updated On:

Products Versions
ibi WebFOCUS All versions

Description

Issue/Introduction

This article will cover an example of using a back tick in number format through procedure

Environment

Windows and Linux

Resolution

A.) When using the below code : 

GRAPH FILE WF_RETAIL_LITE
SUM COGS_US GROSS_PROFIT_US
BY PRODUCT_CATEGORY
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET STYLE *
type=data, column=n1, bucket=x-axis,$
type=data, column=n2, bucket=y-axis,$
type=data, column=n3, bucket=y-axis,$
*GRAPH_JS
"series": [{"series": "all",
 "dataLabels": {"visible": true, "position": "top", "font": "bold 8pt SansSerif", "color": "blue"}}],
"axisList": {
"y1": {
 "labels": {"font": "bold 10pt Sans-Serif", "color": "red"},
 "numberFormat": "{t.}{d,}#,#.#"}}
*END
ENDSTYLE
END

(NOTE : we will just be playing with this line of code :  "numberFormat": "{t.}{d,}#,#.#"}})
Result : Observe the result in screenshot attached "one.png" and specifically check the one which is circled by the marker.

one
*************************************

B.) Now lets say in the same example you want to show a percent sign in-front of the highlighted data.
We need to make the change below:

All the code will remain as it is except "numberFormat line" which will look as below:
"numberFormat": "{t.}{d,}#,#.#%"}})

>> As soon as we add a percent sign, observe the changes as shown in the attached screenshot "two.png"
>> As soon as we add the % sign, it multiplies the value by 100 and then shows the % sign.

two

**************************************

C.) Now, here the backtick comes into the picture.
Now if you don't want the calculation to happen and just display the % sign in front of those numbers , 
try the below code :
"numberFormat": "{t.}{d,}#,#.#`%"}})

>> Observer the result in the attached screenshot "three.png".
>> No calculation has been done i.e. value remained the same as original along with the %sign .

three

***********************************