I’ve a cellular software developed with Ionic 6 (Angular) for each Android and iOS. The software program that this app corresponds to permits customers to mannequin knowledge in tables, like a relational knowledge base. The person has the flexibility to outline enumerations for desk fields; so a area may be of sort Decimal and solely enable the values outlined from the configured enumeration.
On iOS, making an attempt to create or edit fields which can be configured as Decimal enumeration is failing as a result of values like 3.67
are being despatched to the server as 3.69999999999999
. The Angular a part of the app is sending the right worth (3.67
), however for the reason that native code is decoding it as a Double
, what’s find yourself being despatched to the server is the worth with the precision of a Double
.
Though the native app is constructed with Capacitor, it makes use of the superior http cordova plugin to deal with HTTP requests.
I am pretty new to cellular growth typically, so I am undecided if this may be dealt with by a customized cordova or capacitor plugin, or if I might want to switch the generated iOS undertaking immediately. My important concept was to constructed some type of HTTP interceptor to transform the Doubles into Decimals within the native aspect.