Arduino 1.0 new Serial commands

You can do this much simpler now with the parseInt and parseFloat commands.
If you use newline as terminator (/n) you can just type the command in your serial monitor and press enter.

The example online.

Just put commas, spaces or other characters in between the numbers, it works all.