Menu

Possible String replace() changed

strelsi
2023-10-03
2023-10-03
  • strelsi

    strelsi - 2023-10-03

    Hi,

    I used this simple regexp, but it doesn't work correctly in the latest version.

    function numberWithCommas(x, arg)
    {
        arg || ( arg = ".");
        return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, arg);
    }
    

    numberWithCommas(1234567)=1..234..567
    numberWithCommas(1234567,'#')=1##234##567

    Thank in advance.

     
  • Stefan Zieker

    Stefan Zieker - 2023-10-03

    Hi,
    ScriptCommunicator uses Qt 6.4 now (instead of Qt 5.14). They added a new the script engine. That's the reason for the different behavior (maybe this is a bug in the new script engine?). Sorry but I cannot do anything because ScriptCommunicator just uses the Qt script engine.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.