square-restaurant-38765
07/06/2023, 11:48 AMif (growthBook.isOn("discount")) {}
even though similar features are giving enabled response.helpful-application-7107
07/06/2023, 9:14 PMdiscount
?square-restaurant-38765
07/06/2023, 9:15 PMhelpful-application-7107
07/06/2023, 9:17 PMisOn
should always return true, since the value is always non-zero.square-restaurant-38765
07/06/2023, 9:17 PMhelpful-application-7107
07/06/2023, 9:26 PMgrowthBook.getFeatureValue("discount", 0);
in the same place it returns an Integer of 10 or 20?square-restaurant-38765
07/06/2023, 9:26 PMhelpful-application-7107
07/06/2023, 9:39 PMsquare-restaurant-38765
07/06/2023, 9:40 PMbetter-magician-65629
07/06/2023, 10:11 PMFeatureResult#isOn
method. it has to do with all the numeric types in java (double vs. float vs. integer, etc.).
here's a workaround until we get this fixed:
FeatureResult<Float> donutPriceFeatureResult = growthBook.evalFeature("donut_price", Float.class);
System.out.printf("Donut price feature result %s\n", donutPriceFeatureResult);
System.out.printf("Donut price feature is on %s\n", donutPriceFeatureResult.isOn()); // there is a bug here (this is the one you found)
System.out.printf("Donut price feature is on %s\n", donutPrice != 0.0f); // workaround
square-restaurant-38765
07/06/2023, 10:41 PMbetter-magician-65629
07/06/2023, 11:20 PM