[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: New repo in kdereview: kalk
From:       Carl Schwan <carl () carlschwan ! eu>
Date:       2021-05-04 18:03:31
Message-ID: LyEAW2qMoPjtRTbgfEzef6q525b9coc-xpldVhci-4HMZ5R3CeVfnrMTybB7ihk8hGs_N9FmW4Powo3FuPTUPGGq4DVjF_HvLTc8wvTXEig= () carlschwan ! eu
[Download RAW message or body]

You probably want to look at https://doc.qt.io/qt-5/qlocale.html#toFloat for
converting the numbers from strings to floats. This also probably means that
you need to tell Flex to consider 1.000,000 as a single token and find a way
to convert it as a float before giving it to Bison.

I hope this help, it's a while I didn't use Flex (and I never used Bison).

Cheers,
Carl


Le mardi, mai 4, 2021 7:00 PM, hanyoung <hanyoung@protonmail.com> a écrit  :

> Flex doesn't take care of separators, MPFR and GMP do. Flex is merely scanning for \
> numbers and operators to pass to Bison. 
> Sent with ProtonMail Secure Email.
> 
> ------- Original Message -------
> On Wednesday, May 5, 2021 12:56 AM, Thomas Baumgart thb@net-bembel.de wrote:
> 
> > Han,
> > On Dienstag, 4. Mai 2021 11:36:04 CEST hanyoung wrote:
> > 
> > > Pushed an inelegant solution - include "," as decimal separator in flex. As \
> > > long as there aren't any more decimal separator we're cool.
> > 
> > Not sure if this appropriate, but I wanted to warn you about the dilemma that in \
> > some locale the thousand separator and the decimal symbol are exactly the \
> > opposite. Example: German locale: 1.000,00 -> one thousand
> > US locale : 1,000.00 -> one thousand
> > So simply treating the comma and the dot alike without taking the locale into \
> > account may result in wrong values. Cheers,
> > Thomas
> > 
> > > ------- Original Message -------
> > > On Tuesday, May 4, 2021 6:54 AM, Albert Astals Cid aacid@kde.org wrote:
> > > 
> > > > Added a failing test \
> > > > athttps://invent.kde.org/plasma-mobile/kalk/-/merge_requests/22 Now you have \
> > > > to make it work :) Cheers,
> > > > Albert
> > 
> > --
> > Regards
> > Thomas Baumgart
> > https://www.signal.org/ Signal, the better WhatsApp
> > 
> > Of all the computing resources available, the most valuable one is
> > programmers' time. Especially in open source where most of us have to
> > sneak in time to write and debug code. (Ace Jones)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic