Java Tutorial 14 - DecimalFormat (Rounding, adding comas, etc.)

preview_player
Показать описание
After watching this, you'll know know how to use this syntax.
Рекомендации по теме
Комментарии
Автор

thanks Brody. you explained it better than my teacher.

yon
Автор

thanks....now my java doesn't look confusing

IAmJaQuanRobinson
Автор

It seems that the formatting can only happen in the final output. Doesn't seem it can be used in a Double Variable. So if I wanted to create a Double, to just hang on to this formatting, can't be done. Maybe you could help me, and show me how it can be stored in a variable. I actually got what I wanted, but I also would like to know how to store the value in a Variable, preferably a Double. For what it's worth, thanks. (+1 : 29).

If you could help, with declaring a variable, while holding the formatted number, that would be very good. I'd be very grateful. I'm working with Android Studio, so learning Java is helping me allot. Not making any money, just doing small Calculating Apps for my personal use. On my Samsung Galaxy Note 4.

RoyAndrews
Автор

@hellsing357 It's recommended that you just use the 0s.

JohnGizdich
Автор

one problem
i input 100
and it prints out 100.0
i input 5
and it prints out 5.0
how do i disable that decimal from appearing?
so i just want to print out 5 when i input 5 not 5.0

VDEngineering
Автор

@MrGIZDICH
ahhh..
Thank you for replying and hope to see more of your videos
:D
More power and GOd Bless

hellsing