在sprintf中添加变量之间的间隔

I've got this code snippet:

$format = '%s' . $format;
return sprintf($format, number_format((double)$amount, $decimal, $decimal_point, $thousand_sep), $currency);

I would like to add an interval/blank space that would show up between number_format and $currency. Can you tell me how this could be achieved? Thank you.

I'm not 100% sure what you're trying to do, but it looks like you want to format your string like this:

$format = '%s %s';
return sprintf($format, number_format((double)$amount, $decimal, $decimal_point, $thousand_sep), $currency);

PS: I don't know where the $format = '%s' . $format; came from, as you haven't specified what value $format was assigned to before that statement.

Also, it can't hurt to read: http://php.net/manual/en/function.sprintf.php

EDIT: if the number_format() function returns a double change $format = '%s %s'; to $format = '%g %s';