I'm not sure what exactly your book says, but would recommend reviewing the PHP documentation online for pretty helpful usage details:
http://us2.php.net/manual/en/function.sprintf.php
to 'treat the argument as an integer' could mean a variety of things. try suppling a string like "foo" as your argument and see what comes out. Try supplying an integer and then a float and see if there's any difference. Keep in mind that every number ends up being stored in a memory location somewhere (or a series of memory locations, depending on how much data it contains). By "treating" I think the documentation means to suggest that the function will look at the memory location of the supplied 2nd parameter and interpret its contents as an integer. I'm not sure how to ferret out what exactly the difference is between these two vars, but I expect the memory location that stores them might have different bits and bytes in it. I have no idea how PHP will "treat" your second parameter, I just want to show you that numbers have different binary encodings depending on how you "treat" them:
$v1 = 7;
echo gettype($v1) . PHP_EOL; // "integer"
$bytes1 = pack('i', $v1); // pack as signed integer (machine dependent size and byte order)
echo bin2hex($bytes1) . PHP_EOL; // "07000000" on my machine, your results may vary
$v2 = 7.00000;
echo gettype($v2) . PHP_EOL; // "double"
$bytes2 = pack('d', $v2); // pack as double (machine dependent size and representation)
echo bin2hex($bytes2) . PHP_EOL; "0000000000001c40" on my machine, your results may vary
You may want to check out the docs on [man]pack[/man] to get an idea of how data types may vary in their binary representation. There is also a mention in there of signed decimals and unsigned decimals.
As for 'formatting' of these numbers, we can output them as binary, octal, decimal, hexadecimal, or possibly other ways. The number 15 (a decimal number) is represented in hexadecimal as F