fix issue where only 0 would be emitted for non-scientific-notation numbers

This commit is contained in:
ConnorSkees 2020-04-28 14:46:40 -04:00
parent a183a9ffa2
commit a9ec7ff73f
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ use peekmore::PeekMoreIterator;
use crate::error::SassResult; use crate::error::SassResult;
use crate::Token; use crate::Token;
#[derive(Debug)]
pub(crate) struct ParsedNumber { pub(crate) struct ParsedNumber {
pub num: String, pub num: String,
pub dec_len: usize, pub dec_len: usize,

View File

@ -3,7 +3,7 @@ use std::mem;
use num_bigint::BigInt; use num_bigint::BigInt;
use num_rational::BigRational; use num_rational::BigRational;
use num_traits::{pow, One, ToPrimitive, Zero}; use num_traits::{pow, One, ToPrimitive};
use codemap::{Span, Spanned}; use codemap::{Span, Spanned};
@ -631,7 +631,7 @@ impl Value {
}; };
let times_ten = if val.times_ten.is_empty() { let times_ten = if val.times_ten.is_empty() {
BigInt::zero() BigInt::one()
} else { } else {
pow( pow(
BigInt::from(10), BigInt::from(10),