Scanner nextDouble - decimal comma or point
I'm just starting with Java and the following is not quite clear to me.
I wrote this piece of very basic code and it only let's me input numbers with a decimal comma, not with a decimal point.
I thought all computer input had to be with a decimal point? Or is this because of locale settings on my pc?
(only tested in Eclips SDK)
Yeppers, Scanner is locale aware, so the number format is based on your system locale.
You can change it using the scanner's useLocale(Locale) method.
Thank you! :thumbsup:
|All times are GMT +1. The time now is 10:37 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.