Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

Sometimes, you may want to represent the numbers on the report in accounting format.

If the numbers are negative, it will be represented within a bracket with the positive number, e.g. - 500 is represented as (500) in accounting format.

If the numbers are 0, it will be shown as "-".

Here is the sample code for you to transform your number to accounting format. The code of the indicator using is "M_AMOUNT" and the aggregation is SUM.

Code Block
if(M_AMOUNT@SUM == 0) {
  return '-';
}else if(M_AMOUNT@SUM < 0) {
  return '(' + abs(M_AMOUNT@SUM) + ')';
}else {
  return M_AMOUNT@SUM;
}
Sv translation
languageja

レポートの数字をレポート上の数字を会計形式で表現したい場合があるでしょう。で表したい場合があるでしょう。

数字が負である場合、カッコ内の正の数字で表されます、例えば、 - 500は会計形式では (500) として表されます。

数字が0のとき、"-"として表示されます。

数値が負の場合、括弧内に正の数値で表されます。例えば、-500は会計形式では(500)として表されます。

数値が0の場合、「-」として表示されます。

このサンプルコードは、数字を会計形式に変換するものです。インジケータのコードはこのコード例は数字を会計形式に変換するものです。インディケーターのコードは"M_AMOUNT"を使用し、集合はを使用し、集計はSUMです。

Code Block
if(M_AMOUNT@SUM == 0) {
  return '-';
}else if(M_AMOUNT@SUM < 0) {
  return '(' + abs(M_AMOUNT@SUM) + ')';
}else {
  return M_AMOUNT@SUM;
}

...