wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
24.77k stars 1.18k forks source link

int64 number truncation problem #3801

Open dwSun opened 2 days ago

dwSun commented 2 days ago

Description

I'm passing data between golang and the front end, there are two fields, one data field uses int64 but the number is larger, the other is timestamp. the last few digits of the data field are truncated to 0, which is causing some issues with running.

To Reproduce

Just set a function in golang that returns an int64.

Expected behaviour

Both data fields should be returned properly, or a hint should be provided about the truncation of the int64 data field.

Screenshots

FLAMESHOT-2024-10-03_23-31-42

Attempted Fixes

我现在用string代替了int64,但是用起来不是很方便

System Details

10.8.2

          Wails Doctor          

# Wails
Version         | v2.9.1
Package Manager | pacman

# System
┌──────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Arch Linux                                                            |
| Version      | Unknown                                                               |
| ID           | arch                                                                  |
| Go Version   | go1.23.0                                                              |
| Platform     | linux                                                                 |
| Architecture | amd64                                                                 |
| CPU          | Intel(R) Core(TM) Ultra 7 155H                                        |
| GPU          | Meteor Lake-P [Intel Arc Graphics] (Intel Corporation) - Driver: i915 |
| Memory       | 31GB                                                                  |
└──────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌─────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version                     |
| *docker    | docker       | Installed |                             |
| gcc        | gcc          | Installed | 14.2.1+r134+gab884fffe3fc-1 |
| libgtk-3   | gtk3         | Installed | 1:3.24.43-3                 |
| libwebkit  | webkit2gtk   | Installed | 2.46.1-1                    |
| npm        | npm          | Installed | 10.8.2                      |
| pkg-config | pkgconf      | Installed | 2.1.1-1                     |
└────────────────────── * - Optional Dependency ──────────────────────┘

# Diagnosis
 SUCCESS  Your system is ready for Wails development!

Additional context

No response

ankitpatial commented 1 day ago

This is related to JS number range, not a bug in Wails. Try using any JS console, set value 5_130_080_350_652_859_609 to a variable and print it.

dwSun commented 1 day ago

Is it possible to provide a warning about possible data truncation issues when using int64.