Created
September 15, 2017 14:58
-
-
Save erikyo/b6290a60599491a1a88b711b70ebcccd to your computer and use it in GitHub Desktop.
SASS floor with precision (allow decide how many decimals floor return)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// floor with precision function | |
@function decimal_floor( $val , $precision: 2 ) { | |
$n: 1; | |
@for $d from 1 through $precision { | |
$n: $n * 10; | |
} | |
@return floor($val * $n) / $n; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment