threepointone / bs-nice

css-in-reason
180 stars 14 forks source link

fix string of float translation #11

Closed lpalmes closed 6 years ago

lpalmes commented 6 years ago

hey @threepointone,

first of all great library, i'm finishing my jsxnice bindings, i'm pretty excited to use them on my own code, while using the library i found out that dimension were having a bit of trouble with string_of_float given that if i make this string_of_float(100.) it will output 100.0, so dimensions where like this on the css width: 100.% and at least firefox was angry that 100. is not a proper value

so the fix is to change every string_of_float to Printf.sprinf("%f", v) that will output 100.0000000 but i don't think that will be a problem, thanks a lot!

threepointone commented 6 years ago

Thanks!

thangngoc89 commented 6 years ago

I think Js.Float.toString method is our friend here. To uses JS semantic and more lightweight. But if we stick with Printf.sprintf, why don’t we use it to write the whole string? Less string concatenation to do

lpalmes commented 6 years ago

makes sense, i just hotfixed the problem i was having, i like that idea

threepointone commented 6 years ago

Trying to stay away from Js specific code fyi