remixings icon indicating copy to clipboard operation
remixings copied to clipboard

rem to 2 decimal places

Open freakyleaf opened this issue 10 years ago • 1 comments

Have started accommodating half pixel values for high DPI screens, and found that pxtorem currently only outputs to 1 decimal place...

Changed @pxtorem-js-function to the following to allow 2 decimal place calculations... Not tested exhaustively though...

@pxtorem-js-function: ~`pxtorem = function(px){ if (typeof rmxsBaseFontSize == 'undefined')  rmxsBaseFontSize = @{base-font-size-px}; return (parseFloat(px.replace(/(^\d+)(\.\d{1,2})?$(.+$)/i,'$1')) / rmxsBaseFontSize + 'rem') }`;

freakyleaf avatar Feb 02 '15 14:02 freakyleaf

Thanks for your contribution @freakyleaf. Would you please provide a pull request with your changes?

christopher-ramirez avatar Feb 03 '15 16:02 christopher-ramirez