1--TEST-- 2sprintf %f #3 3--SKIPIF-- 4<?php 5if (setlocale(LC_ALL, 'invalid') === 'invalid') { die('skip setlocale() is broken /w musl'); } 6if(false == setlocale(LC_NUMERIC, "is_IS", "is_IS.UTF-8")) print "skip icelandic locale not supported"; 7?> 8--FILE-- 9<?php 10setlocale(LC_NUMERIC, "is_IS", "is_IS.UTF-8"); 11var_dump(sprintf("%.3f", 100.426)); 12var_dump(sprintf("%.2f", 100.426)); 13var_dump(sprintf("%f'", 100.426)); 14 15$money1 = 68.75; 16$money2 = 54.35; 17$money = $money1 + $money2; 18var_dump(sprintf("%01.2f", $money)); 19var_dump(sprintf("%.3e", $money)); 20?> 21--EXPECT-- 22string(7) "100,426" 23string(6) "100,43" 24string(11) "100,426000'" 25string(6) "123,10" 26string(8) "1.231e+2" 27