14 Commits

Author SHA1 Message Date
Connor Skees
b28309147e partially implement inverse units 2020-07-04 11:04:51 -04:00
ConnorSkees
e5cceb60ec track span_before when parsing values
this allows us to remove many panics on invalid input
2020-05-24 15:30:06 -04:00
ConnorSkees
b5c1fb2013 ignore non-ascii numeric characters in numbers 2020-05-24 13:08:31 -04:00
ConnorSkees
f3e7abdaba allow units to begin with escape sequences 2020-05-16 18:54:42 -04:00
ConnorSkees
637dc39544 prefer #[ignore] over commenting out tests 2020-04-25 12:16:10 -04:00
ConnorSkees
4346756e9e disallow - in unit when followed by [0-9\.] 2020-04-20 04:05:02 -04:00
ConnorSkees
0a5c6b907c test mul unit display errors 2020-04-18 19:50:14 -04:00
ConnorSkees
bb87d4f4c0 handle percent op none 2020-03-31 02:11:02 -04:00
ConnorSkees
0fe97993f4 Properly handle trailing zeroes
This fixes an edge case in which there were trailing zeros that resulted
from the decimal having a non-zero part outside the precision range.

E.g. if precision were 10, `0.00000000000000000001` would be printed as `0.0000000000`.

This issue occured often when doing unit conversions between cm and in
(and similarly between dpcm and dpi).
2020-03-18 10:34:17 -04:00
ConnorSkees
efaa33088b Implement unit conversions in numeric subtraction 2020-03-18 10:14:35 -04:00
ConnorSkees
b3b5163113 Implement unit conversions in numeric addition 2020-03-18 10:08:40 -04:00
ConnorSkees
3b5dd73a65 Support arbitrary amount of numbers multiplied together 2020-03-17 10:06:24 -04:00
ConnorSkees
f57b08069d Handle unit multiplication 2020-03-16 21:29:00 -04:00
ConnorSkees
b8bacbde8b Refactor tests into separate files 2020-02-01 23:09:22 -05:00