Skip to content

Instantly share code, notes, and snippets.

@ceee
Created July 26, 2013 11:41
Show Gist options
  • Save ceee/6088235 to your computer and use it in GitHub Desktop.
Save ceee/6088235 to your computer and use it in GitHub Desktop.
Provides a Sass function, which rounds a number by the given precision
@function precision($value, $precision)
{
$base: 10;
$divisor: 1;
@for $i from 1 through $precision
{
$divisor: $divisor * $base;
}
@return round( $value * $divisor ) / $divisor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment