[PATCH v2 1/6] jscript: Implement Number.prototype.toLocaleString.

Gabriel Ivăncescu gabrielopcode at gmail.com
Thu Apr 21 13:11:41 CDT 2022


Hi Jacek,

On 21/04/2022 15:45, Jacek Caban wrote:
> Hi Gabriel,
> 
> On 4/20/22 18:56, Gabriel Ivăncescu wrote:
>> Signed-off-by: Gabriel Ivăncescu<gabrielopcode at gmail.com>
>> ---
>>
>> I kept the fraction removal since I couldn't think of a better way for
>> now. However, the other improvements have been done.
> 
> 
> Could we just modify the existing toString() code to optionally take 
> into account localized separators and required customizations? It seems 
> to me that avoiding exponential form is simply a matter of using a 
> larger buffer for localized string.
> 

Do you mean to localize the entire number ourselves in toString? Or just 
the sprintf part? (so it can be passed to GetNumberFormatW)

I don't know if localizing the number in toString without using an API 
like GetNumberFormatW is a good idea—I certainly don't know the required 
customizations for each locale, having to implement them sounds like a 
lot of duplication, and is it possible they could even change in the future?

> 
> Also, it would be nice to have better tests. For jscript mode, you 
> should be able to change GetLCID() to force using English locale. For 
> HTML mode, you may run those tests only for English locale.
> 

OK, I'll see what I can do about the English tests at least.

Thanks,
Gabriel



More information about the wine-devel mailing list