https://tracker.xojo.com/xojoinc/xojo/-/issues/75758
I know it’s asking a lot, but this case has been open 10 months and all it needs is an attribute removed so the analyzer stops complaining about the DecimalFormat property.
https://tracker.xojo.com/xojoinc/xojo/-/issues/75758
I know it’s asking a lot, but this case has been open 10 months and all it needs is an attribute removed so the analyzer stops complaining about the DecimalFormat property.
@William_Yu
@Javier_Menendez
Thank you !
Now marked as ‘By Design’
Something is either deprecated and not going to receive fixes, or receives fixes and therefore is not deprecated. Xojo can’t have it both ways. Fixing a bug in a deprecated property means a) it’s not really deprecated and b) its functionality is still needed.
As I mentioned in the case, if they want to keep it deprecated, I’m fine with that. But give us a replacement.
Ok so marking the case as “by design” is actually the right move. After understanding the issue more, I agree that DecimalFormat should be deprecated. If I had to change anything about how the case has been handled, I would suggest that the reason for the deprecation should have been added to the case when it was marked as by design.
The issue is DecimalFormat works too well. It allows you to turn a double into a formatted string, which can produce invalid JSON.
For example:
Var Test As New JSONItem
Test.Value("1000") = 1000.0
Test.DecimalFormat = "#,##0"
Call Test.ToString() // Produces {"1000":1,000}
When used correctly, it’s a life saver. But when used incorrectly, it’s a big problem.
I discussed some alternatives with Geoff yesterday, but it’s not my place to reveal any details. I’ll leave that for the team. I will say I’m hopeful though.
Thank you for the explanation and for the time to try to make a good alternative for DecimalFormat in a future version of Xojo.