Tag Archives: floating-point numbers

Formatting Decimals

How can you format decimal-point (floating-point) numbers to a specific precision? Ruby has a sprintf function that allows you to do this. It takes a number and a string of a specific format, and returns the number rounded to the precision you specified. Continue reading

Posted in Development | Tagged , , , | 1 Comment