I'm concerned with how much I'm going to have to pay for this gift card
-
-
That's silly, Chili's doesn't even have nan on the menu.
-
WTF? How can you get a NaN in Android? You have to fuck up a lot to show undefined and NaN... unless Cordova.
-
$50.89 - undefined = NaN?
I mean, Android is Javaish, NaN is a thing.
I'm also on CM12, so maybe a ART thing?
-
WTF? How can you get a NaN in Android? You have to fuck up a lot to show undefined and NaN... unless Cordova.
Or simply displaying a string retrieved from somewhere else.
-
But it shows the correct value in previous pages.
-
Different source, then.
-
I mean, Android is Javaish, NaN is a thing.
Nope, try again. Java is statically typed so you would get a type error. Even
String.format("US$%d", "Foo")
fucks up because it's not a number.
-
But it could be Double.isNaN(...) = true.
-
You mean something like:
Object crap = ...; if(Double.isNaN(crap)) label.setText("$NaN"); else label.setText(crap.toString());
That makes no sense.
-
public class HelloWorld{ public static void main(String []args){ System.out.println(0.0/0.0); } }
-
You're right, but then, the WTF is even worst when your view is doing arithmetic operations that should be done by a controller.
-
http://goo.gl/7pSbxm
That's a surprisingly full-featured terminal window, you can even run python or lua within it.
-
Thanks random google for online java environment!
-
Who says the View is doing the operations? Even if the controller does the operation, the value the UI is passed will be Float.NaN (Or, you know, Float.NaN.toString() which is "NaN")
-
Nope, try again. Java is statically typed so you would get a type error. Even String.format("US$%d", "Foo") fucks up because it's not a number.
Nope backatcha; not all that is a
double
is numeric…
-
But it could be Double.isNaN(...) = true.
Then it's even worse if they're storing the cash amount as doubles. Will people never learn...