Revision 3603b96e
Added by Andreas Kohlbecker over 3 years ago
modules/cdm_dataportal/includes/common.inc | ||
---|---|---|
406 | 406 |
$min_max_markup = str_replace($xbar_equals, '' , $other_vals_array['Average']); |
407 | 407 |
unset($other_vals_array['Average']); |
408 | 408 |
} |
409 |
if($unit){ |
|
410 |
$min_max_markup .= ' ' . $unit; |
|
411 |
} |
|
409 | 412 |
if(count($other_vals_array)){ |
410 | 413 |
$min_max_markup .= ' [' . join(';', $other_vals_array) . ']'; |
411 | 414 |
} |
412 | 415 |
|
413 |
return $min_max_markup . ($unit ? ' ' . $unit : '');
|
|
416 |
return $min_max_markup; |
|
414 | 417 |
} |
415 | 418 |
|
416 | 419 |
/** |
modules/cdm_dataportal/test/phpUnit/src/unit/StatisticalValuesTest.php | ||
---|---|---|
84 | 84 |
function test_statistical_values_with_unit() { |
85 | 85 |
|
86 | 86 |
$stat_vals = $this->create_statistical_values(2.2, 8.7, 5.234, 5, 0.3, 0.12); |
87 |
$this->assertEquals('2.2–8.7 [5;x̄=5;σ²=0.3;σ=0.12] cm', $this->html2text(statistical_values($stat_vals, 'cm')));
|
|
87 |
$this->assertEquals('2.2–8.7 cm [5;x̄=5;σ²=0.3;σ=0.12]', $this->html2text(statistical_values($stat_vals, 'cm')));
|
|
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
|
Also available in: Unified diff
ref #8830 statistical values: unit before brackets