Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float values parsed wrong (SOLUTION: upgrade to latest version) #74

Closed
matse02 opened this issue Jul 18, 2024 · 3 comments
Closed

float values parsed wrong (SOLUTION: upgrade to latest version) #74

matse02 opened this issue Jul 18, 2024 · 3 comments
Labels
maintainer can't replicate The core dev can't replicate this issue, making a fix difficult

Comments

@matse02
Copy link

matse02 commented Jul 18, 2024

origin:

{"Voltage":{"v":242.6999969,"u":"V","d":1}}

output pretty print:

{
"Voltage":
{
"d": 1,
"u": "V",
"v": 2426999969.0
}
}

@molsonkiko
Copy link
Owner

This was an issue with an older version of JsonTools. Update to the newest version.

Sorry for the inconvenience, though!

@molsonkiko molsonkiko pinned this issue Jul 18, 2024
@molsonkiko molsonkiko changed the title float values wrong in pretty print and tree view float values wrong in pretty print and tree view (SOLUTION: upgrade to latest version) Jul 18, 2024
@molsonkiko molsonkiko changed the title float values wrong in pretty print and tree view (SOLUTION: upgrade to latest version) float values parsed wrong (SOLUTION: upgrade to latest version) Jul 18, 2024
@matse02
Copy link
Author

matse02 commented Jul 22, 2024

Thank you for your reply!
I just upgraded to JsonTools V8, restarted NPP, verified via Plugins/JsonTools/About that v8 ir running ,
but still the same error, foatin point number have wrong deciamals, (other values and sample above used to check.)

@molsonkiko
Copy link
Owner

molsonkiko commented Jul 22, 2024

@matse02

I just upgraded to JsonTools V8, restarted NPP, verified via Plugins/JsonTools/About that v8 ir running ,
but still the same error, foatin point number have wrong deciamals, (other values and sample above used to check.)

Thanks for letting me know you're still experiencing the issue. This doesn't seem possible, though, because my JSON formatting code is no longer culture-sensitive, and I can verify this by setting my UI culture to one that uses , as the decimal separator (like French or German), performing your test, and not observing the issue you described, even though making that change caused the issue on older versions of JsonTools.

Could you please paste the following two things in a new comment?

  1. Your current UI culture (open PowerShell, enter the command get-culture, and paste the result)
    LCID             Name             DisplayName
    ----             ----             -----------
    1036             fr-FR            French (France)
    
  2. Your Debug Info (?->Debug Info... from the Notepad++ main menu)
    Notepad++ v8.6.9   (64-bit)
    Build time : Jul 12 2024 - 05:09:25
    Path : C:\Program Files\Notepad++\notepad++.exe
    Command Line : 
    Admin mode : OFF
    Local Conf mode : OFF
    Cloud Config : OFF
    Periodic Backup : ON
    OS Name : Windows 10 Home (64-bit)
    OS Version : 22H2
    OS Build : 19045.4651
    Current ANSI codepage : 1252
    Plugins : 
        ColumnsPlusPlus (1.1.1)
        ComparePlus (1.1)
        CSharpPluginPack (0.0.3.8)
        CSVLint (0.4.6.6)
        EnhanceAnyLexer (1.1.3)
        HTMLTag (1.4.3.1)
        HugeFiles (0.4.1)
        JsonTools (8.0.0.13)
        mimeTools (3.1)
        NavigateTo (2.7)
        NppConverter (4.6)
        NppExport (0.4)
        NppLspClient (0.0.21)
        PythonScript (3.0.16)
        XMLTools (3.1.1.13)
    
  3. The result of pretty-printing {"Voltage":{"v":242.6999969,"u":"V","d":1}} using JsonTools v8. Assuming indent_pretty_print = 4, sort_keys = False, tab_indent_pretty_print = False, and pretty_print_style = Google, it should be
    {
        "Voltage": {
            "v": 242.6999969,
            "u": "V",
            "d": 1
        }
    }
    
  4. The result of compressing {"Voltage":{"v":242.6999969,"u":"V","d":1}} using JsonTools v8. Assuming sort_keys = False and minimal_whitespace_compression = True, this should be {"Voltage":{"v":242.6999969,"u":"V","d":1}}

@molsonkiko molsonkiko added the maintainer can't replicate The core dev can't replicate this issue, making a fix difficult label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer can't replicate The core dev can't replicate this issue, making a fix difficult
Projects
None yet
Development

No branches or pull requests

2 participants