I want to create a classes as .rating-1-1{}, .rating-1-2{}, till 10.0 . Here 1-1 means it is 1.1. Where i want to replace decimal point with - . In my current implementation
Use simple arithmetics and numeric functions, e.g.:
.loop(3);
.loop (@n, @j: @n) when (@j > 0) {
.loop(@j, @j - 1/10);
@i: floor(@j); // integer part
@f: floor(mod(@j, 1)*10); // fractional part
.foo-@{i}-@{f} {
width: 10% * @j;
}
}
this will generate classes from foo-0-0
to foo-3-0
.
Demo.
When numeric conversion are not applicable use replace