FIX[Format-parser]: Parse [$€]#,##0.00 correctly

We will need to have a look at the format parser sooner rather
than later though
This commit is contained in:
Nicolás Hatcher
2024-12-09 19:39:23 +01:00
parent 2f2a5e4fba
commit 4ef8a6882f
5 changed files with 28 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ pub struct NumberPart {
pub is_scientific: bool,
pub scientific_minus: bool,
pub exponent_digit_count: i32,
pub currency: Option<char>,
}
pub struct DatePart {
@@ -114,6 +115,7 @@ impl Parser {
let mut exponent_digit_count = 0;
let mut number = 'i';
let mut index = 0;
let mut currency = None;
while token != Token::EOF && token != Token::Separator {
let next_token = self.lexer.next_token();
@@ -170,6 +172,9 @@ impl Parser {
Token::Condition(cmp, value) => {
condition = Some((cmp, value));
}
Token::Currency(c) => {
currency = Some(c);
}
Token::QuestionMark => {
tokens.push(TextToken::Digit(Digit {
kind: '?',
@@ -291,6 +296,7 @@ impl Parser {
is_scientific,
scientific_minus,
exponent_digit_count,
currency,
})
}
}