English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How do i turn a double into an int so I an use it with a while ( boolean ) statement?

Ex:
double percent
.
.
.
while ( percent > 60)

2007-12-11 04:10:08 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Do it the other way around.

double limit = 60.0;
while (percent > limit)

2007-12-11 04:24:11 · answer #1 · answered by SWEngr 3 · 0 0

(int)percent will cast it to an integer.

2007-12-11 12:23:53 · answer #2 · answered by daa 7 · 0 0

fedest.com, questions and answers