We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e12beb3 commit efbd58cCopy full SHA for efbd58c
1 file changed
src/scss/02-tools/_f-to-number.scss
@@ -2,6 +2,23 @@
2
@use "sass:math";
3
@use "sass:string";
4
5
+/**
6
+ * To number - convert string to number
7
+ *
8
+ * @author: Stackoverflow - https://stackoverflow.com/questions/47630616/scss-arithmetic-operation-with-string
9
10
+ * @param string $value
11
12
+ * Examples :
13
+ * @for $i from 1 through 6 {
14
+ * &[data-per-line="#{$i}"] {
15
+ * .card {
16
+ * width: column(to-number(#{math.div(12, $i + 1)}));
17
+ * }
18
19
20
+ */
21
+
22
@function to-number($value) {
23
@if type-of($value) == "number" {
24
@return $value;
0 commit comments