Posts

Showing posts with the label decimal

Salesforce Fact #882 | Handling decimal data in LWC returned from apex wrapper

Image
We need to be careful while dealing with large decimal values in LWC returned from apex in wrapper structure. If the value is large, it is converted to String to avoid any loss of precision. Reference:  https://salesforce.stackexchange.com/questions/327214/lwc-autoconverting-decimal-into-string-sf-bug Attached are the screenshots.

Salesforce Fact #879 | Removing decimals in JS

Image
In order to remove decimals from a number in JS, we can make use of the bitwise not operator. Same can be used in LWC. Attached is an example screenshot.