@@ -101,7 +101,7 @@ public function test_validate_success($value, $min, $max, $decpoint = '.')
101
101
public function valueProvider ()
102
102
{
103
103
return array (
104
- // $value, $expect, $roundto, $decpoint, $thousands, $trimzeros, $prefix='', $postfix=''
104
+ // $value, $expect, $roundto, $decpoint, $thousands, $trimzeros, $prefix='', $postfix='', $engineering = false
105
105
array ('5000 ' , '5 000,00 ' , '2 ' , ', ' , ' ' , false ),
106
106
array ('5000 ' , '5 000 ' , '2 ' , ', ' , ' ' , true ),
107
107
array ('5000 ' , '5 000 ' , '0 ' , ', ' , ' ' , false ),
@@ -117,21 +117,41 @@ public function valueProvider()
117
117
118
118
array ('-0.55600 ' , '$ -0,556 ' , '4 ' , ', ' , ' ' , true , '$ ' ),
119
119
array ('-0.55600 ' , '-0,556 EUR ' , '4 ' , ', ' , ' ' , true , '' , ' EUR ' ),
120
+
121
+ //engineering notation
122
+ array ('1e-18 ' , '1 ' ."\xE2\x80\xAF" .'a ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
123
+ array ('1e-15 ' , '1 ' ."\xE2\x80\xAF" .'f ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
124
+ array ('1e-12 ' , '1 ' ."\xE2\x80\xAF" .'p ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
125
+ array ('1e-9 ' , '1 ' ."\xE2\x80\xAF" .'n ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
126
+ array ('1e-6 ' , '1 ' ."\xE2\x80\xAF" .'µ ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
127
+ array ('1e-3 ' , '1 ' ."\xE2\x80\xAF" .'m ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
128
+
129
+ array ('1e3 ' , '1 ' ."\xE2\x80\xAF" .'k ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
130
+ array ('1e6 ' , '1 ' ."\xE2\x80\xAF" .'M ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
131
+ array ('1e9 ' , '1 ' ."\xE2\x80\xAF" .'G ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
132
+ array ('1e12 ' , '1 ' ."\xE2\x80\xAF" .'T ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
133
+
134
+ array ('1e4 ' , '10 ' ."\xE2\x80\xAF" .'k ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
135
+ array ('1e5 ' , '100 ' ."\xE2\x80\xAF" .'k ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
136
+
137
+ array ('1e15 ' , '100 ' ."\xE2\x80\xAF" .'k ' , '-1 ' , ', ' , ' ' , true , '' , '' , true ),
138
+
120
139
);
121
140
}
122
141
123
142
/**
124
143
* @dataProvider valueProvider
125
144
*/
126
- public function test_renderValue ($ value , $ expect , $ roundto , $ decpoint , $ thousands , $ trimzeros , $ prefix = '' , $ postfix = '' )
145
+ public function test_renderValue ($ value , $ expect , $ roundto , $ decpoint , $ thousands , $ trimzeros , $ prefix = '' , $ postfix = '' , $ engineering = false )
127
146
{
128
147
$ decimal = new Decimal (array (
129
148
'roundto ' => $ roundto ,
130
149
'decpoint ' => $ decpoint ,
131
150
'thousands ' => $ thousands ,
132
151
'trimzeros ' => $ trimzeros ,
133
152
'prefix ' => $ prefix ,
134
- 'postfix ' => $ postfix
153
+ 'postfix ' => $ postfix ,
154
+ 'engineering ' => $ engineering ,
135
155
));
136
156
$ R = new \Doku_Renderer_xhtml ();
137
157
$ R ->doc = '' ;
0 commit comments