Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display Thousends Milions etc. in resource info #475

Open
p1plp1 opened this issue Aug 23, 2020 · 0 comments
Open

display Thousends Milions etc. in resource info #475

p1plp1 opened this issue Aug 23, 2020 · 0 comments

Comments

@p1plp1
Copy link

p1plp1 commented Aug 23, 2020

void
PopupBox::draw_green_number(int sx, int sy, int n) {
if (n >= 1000000000) {/bilion/
int ntmp = n / 1000000000;
frame->draw_number(8 * sx + 8, 9 + sy, ntmp, Color::green);
frame->draw_string(8 * (sx + (ntmp<10 ? 1 : 2)) + 8, sy + 9, "B", Color::green);
} else if (n >= 100000000) {
int ntmp = n / 100000000;
frame->draw_string(8 * sx + 8, sy + 9, "B", Color::green);
frame->draw_number(8 * (sx + 1) + 8, 9 + sy, ntmp, Color::green);
} else if (n >= 1000000) {/milion/
int ntmp = n / 1000000;
frame->draw_number(8 * sx + 8, 9 + sy, ntmp, Color::green);
frame->draw_string(8 * (sx + (ntmp<10 ? 1 : 2)) + 8, sy + 9, "M", Color::green);
} else if (n >= 100000) {
int ntmp = n / 100000;
frame->draw_string(8 * sx + 8, sy + 9, "M", Color::green);
frame->draw_number(8 * (sx + 1) + 8, 9 + sy, ntmp, Color::green);
} else if (n >= 1000) { /* thousend */
int ntmp = n / 1000;
frame->draw_number(8 * sx + 8, 9 + sy, ntmp, Color::green);
frame->draw_string(8 * (sx + (ntmp<10 ? 1 : 2)) + 8, sy + 9, "T", Color::green);
} else {
frame->draw_number(8 * sx + 8, 9 + sy, n, Color::green);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant