@@ -352,7 +352,7 @@ function testColumnParsing() {
352
352
* @return void
353
353
*/
354
354
function testValueQuoting () {
355
- $ this ->assertIdentical ($ this ->db2 ->value (1.2 , 'float ' ), "'1.2 ' " );
355
+ $ this ->assertIdentical ($ this ->db2 ->value (1.2 , 'float ' ), "'1.200000 ' " );
356
356
$ this ->assertEqual ($ this ->db2 ->value ('1,2 ' , 'float ' ), "'1,2' " );
357
357
358
358
$ this ->assertEqual ($ this ->db2 ->value ('0 ' , 'integer ' ), "'0' " );
@@ -378,6 +378,24 @@ function testValueQuoting() {
378
378
$ this ->assertEqual ($ this ->db2 ->value (array ()), "NULL " );
379
379
}
380
380
381
+ /**
382
+ * test that localized floats don't cause trouble.
383
+ *
384
+ * @return void
385
+ */
386
+ function testLocalizedFloats () {
387
+ $ restore = setlocale (LC_ALL , null );
388
+ setlocale (LC_ALL , 'de_DE ' );
389
+
390
+ $ result = $ this ->db ->value (3.141593 , 'float ' );
391
+ $ this ->assertEqual ((string )$ result , "'3.141593' " );
392
+
393
+ $ result = $ this ->db ->value (3.14 );
394
+ $ this ->assertEqual ((string )$ result , "'3.140000' " );
395
+
396
+ setlocale (LC_ALL , $ restore );
397
+ }
398
+
381
399
/**
382
400
* test that date and time columns do not generate errors with null and nullish values.
383
401
*
0 commit comments