-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: We observed that sometimes when logging the value of a transaction, it was logged with an excess number of decimal points (i.e. 4.99 was 4.9900000000000002 or 1.99 was 1.9899999999999998). This can hurt the event quality. The root cause is because doubles do not have as much precision as decimals and when converting the price from a decimal to a double, we lost precision. To fix it, we first round the number to 3 decimal places (this is the most any currency has) and then we log it as an ```NSDecimalNumber``` as opposed to a ```Double``` to maintain precision. Reviewed By: jjiang10 Differential Revision: D64154628 fbshipit-source-id: 9d15b2eb1d94e3631731403fb9ad4a49293f90cd
- Loading branch information
1 parent
5b36751
commit 1b82e1f
Showing
3 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters