NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Wiki Markup
{scrollbar:icons=false}
h1. 

Evaluate

...

Mathematical

...

Expressions

...

with

...

the

...

Number-data

...

and

...

Eval-data

...

Macros

...

This

...

page

...

provides

...

the

...

information

...

on

...

the

...

eval-data

...

macro

...

from

...

the

...

Atlassian

...

site.

...

Table of Contents

...

minLevel

...

2

...

The

...

eval-data

...

macro

...

allows

...

evaluation

...

of

...

mathematical

...

expressions

...

using

...

data

...

in

...

number-data

...

macros.

...

Basic

...

Mathematics

...

The

...

following

...

calculates

...

the

...

value

...

of

...

a

...

fraction,

...

initially

...

1/2.

{
Code Block
}Numerator: {number-data:Numerator|decimal=true}1{number-data}
Denominator: {number-data:Denominator|decimal=true}2{number-data}

Result: {eval-data:Result|format=#0.0}${Numerator}/${Denominator}{eval-data}
Percentage: {eval-data:Percentage|format=##0\%}round(${Result} * 100, 0){eval-data}{code}

*

Observation:

...

The

...

Basic

...

Mathematics

...

example,

...

with

...

the

...

formatting

...

by

...

the

...

java.text.DecimalFormat

...

rules

...

shown

...

in

...

the

...

example

...

from

...

Atlassian,

...

yields

...

the

...

result

...

5000%.

...

To

...

obtain

...

50

...

it

...

was

...

necessary

...

to

...

remove

{
Code Block
}\%{code} 

which

...

is

...

the

...

correct

...

percentage

...

markup

...

and

...

shows

...

the

...

percent

...

sign.

...

Numerator:

...

Number Data

...

nameNumerator

...

decimal

...

true

...

1

Denominator:

...

Number Data

...

nameDenominator

...

decimal

...

true

...

2

Result:

...

Evaluate Data

...

nameResult

...

format

...

#0.0

...

${Numerator}/${Denominator}

...


Percentage:

...

Evaluate Data

...

namePercentage

...

format

...

##0

...

round(${Result} * 100, 0)

...

Evaluating Data in Tables

In the Editview, the text-data

...

and

...

number-data

...

macros

...

present

...

a

...

plus

...

sign

...

with

...

the

...

table.

...

Clicking

...

the

...

plus

...

sign

...

opens

...

the

...

table

...

to

...

accept

...

names

...

of

...

variables

...

and

...

values

...

for

...

them.

...

The

...

eval-data

...

macros

...

calculate

...

the

...

sum

...

and

...

the

...

average.

...

An

...

example

...

follows.

{
Code Block
}{table-data:Values}
|| Name || Value ||
| {text-data:Name}{text-data} | {number-data:Value}{number-data} |
{table-data}

Sum: {eval-data:Sum}sumtable("Values", "Value"){eval-data}
Average: {eval-data:Average}avgtable("Values", "Value"){eval-data}
{code}

{

Table Data

...

nameValues
orderasc

Name

Value

wikiNameINLINE

ValueINLINE

Sum:

Evaluate Data
nameSum
sumtable("Values", "Value")

...


Average:

...

Evaluate Data

...

nameAverage

...

avgtable("Values", "Value")

Wiki Markup
{eval-data}

{scrollbar:icons=false}