Skip to content

Commit

Permalink
Show wrong number if value larger than 1000 and use __() + number_for…
Browse files Browse the repository at this point in the history
…mat_i18n
  • Loading branch information
ddb4github committed Feb 19, 2024
1 parent 8407a78 commit 0376093
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ function utilities_view_tech() {

form_alternate_row();
print "<td>$name</td>";
print '<td>' . __('%0.2f GB', number_format_i18n($value, 2, 1000)) . '</td>';
print '<td>' . __('%s GB', number_format_i18n($value, 2, 1000)) . '</td>';
form_end_row();

if ($name == 'MemTotal') {
Expand Down Expand Up @@ -648,7 +648,7 @@ function utilities_view_tech() {
if ($maxPossibleMyMemory > ($total_memory * 0.8)) {
form_alternate_row();
print '<td>' . __('Max Total Memory Possible') . '</td>';
print '<td class="deviceDown">' . __('%0.2f GB', number_format_i18n($maxPossibleMyMemory, 2, 1000)) . '</td>';
print '<td class="deviceDown">' . __('%s GB', number_format_i18n($maxPossibleMyMemory, 2, 1000)) . '</td>';
form_end_row();
form_alternate_row();
print '<td></td>';
Expand All @@ -657,26 +657,26 @@ function utilities_view_tech() {
} else {
form_alternate_row();
print '<td>' . __('Max Total Memory Possible') . '</td>';
print '<td class="deviceUp">' . __('%0.2f GB', number_format_i18n($maxPossibleMyMemory, 2, 1000)) . '</td>';
print '<td class="deviceUp">' . __('%s GB', number_format_i18n($maxPossibleMyMemory, 2, 1000)) . '</td>';
form_end_row();
}
} else {
form_alternate_row();
print '<td>' . __('Max Total Memory Possible') . '</td>';
print '<td>' . __('%0.2f GB', number_format_i18n($maxPossibleMyMemory, 2, 1000)) . '</td>';
print '<td>' . __('%s GB', number_format_i18n($maxPossibleMyMemory, 2, 1000)) . '</td>';
form_end_row();
}

if ($total_memory > 0) {
if ($systemMemory > ($total_memory * 0.8)) {
form_alternate_row();
print '<td>' . __('Max Core Memory Possible') . '</td>';
print '<td class="deviceDown">' . __('%0.2f GB', number_format_i18n($systemMemory, 2, 1000)) . '&nbsp;&nbsp;(' . __('Reduce Total Core Memory') . '</td>';
print '<td class="deviceDown">' . __('%s GB', number_format_i18n($systemMemory, 2, 1000)) . '&nbsp;&nbsp;(' . __('Reduce Total Core Memory') . '</td>';
form_end_row();
} else {
form_alternate_row();
print '<td>' . __('Max Core Memory Possible') . '</td>';
print '<td class="deviceUp">' . __('%0.2f GB', number_format_i18n($systemMemory, 2, 1000)) . '</td>';
print '<td class="deviceUp">' . __('%s GB', number_format_i18n($systemMemory, 2, 1000)) . '</td>';
form_end_row();
}

Expand All @@ -688,12 +688,12 @@ function utilities_view_tech() {
if ($clientMemory > ($total_memory * 0.8)) {
form_alternate_row();
print '<td>' . __('Max Connection Memory Possible') . '</td>';
print '<td class="deviceDown">' . __('%0.2f GB', number_format_i18n($clientMemory, 2, 1000)) . '&nbsp;&nbsp;(' . __('Reduce Total Client Memory') . ')</td>';
print '<td class="deviceDown">' . __('%s GB', number_format_i18n($clientMemory, 2, 1000)) . '&nbsp;&nbsp;(' . __('Reduce Total Client Memory') . ')</td>';
form_end_row();
} else {
form_alternate_row();
print '<td>' . __('Max Connection Memory Possible') . '</td>';
print '<td class="deviceUp">' . __('%0.2f GB', number_format_i18n($clientMemory, 2, 1000)) . '</td>';
print '<td class="deviceUp">' . __('%s GB', number_format_i18n($clientMemory, 2, 1000)) . '</td>';
form_end_row();
}

Expand All @@ -704,12 +704,12 @@ function utilities_view_tech() {
} else {
form_alternate_row();
print '<td>' . __('Max Core Memory Possible') . '</td>';
print '<td class="deviceUp">' . __('%0.2f GB', number_format_i18n($systemMemory, 2, 1000)) . '</td>';
print '<td class="deviceUp">' . __('%s GB', number_format_i18n($systemMemory, 2, 1000)) . '</td>';
form_end_row();

form_alternate_row();
print '<td>' . __('Max Connection Memory Possible') . '</td>';
print '<td>' . __('%0.2f GB', number_format_i18n($clientMemory, 2, 1000)) . '</td>';
print '<td>' . __('%s GB', number_format_i18n($clientMemory, 2, 1000)) . '</td>';
form_end_row();
}

Expand Down

0 comments on commit 0376093

Please sign in to comment.