sprintf should not be locale aware (because string will be in SQL, that require english formatted float). Change %f to %F