Sass and rounding down numbers. Can this be configured?

compass-sass, css, responsive-design, sass

Solution

If you are using Compass, you can easily specify the precision in your project file (config.rb) without hacking the core:

Sass::Script::Number.precision = 8

For more information see Sass documentation

Problem

Is there any way for me to modify the way that Sass will handle decimal places? I saw a few people saying that Sass will dynamically do the (target/parent)*100 calculation needed for responsive layouts, and output the result at compile time. It even has a percentage function, which will essentially take the two values and do this. Alas, Sass will only ever give me 3 decimal places. My understanding up to this point has been that in some cases, this may not be a sufficient degree of accuracy for all browsers to properly display the layout without any hiccups. Can anyone help me get to the bottom of this? EDIT Solved. Incase anyone else is interested, I managed to accomplish what I wanted in Sass's number.rb, changing the value of @precision. This alters the way all floats are output.

Original source