Commit ad4dd6af authored by Robert Lyon's avatar Robert Lyon

Bug 1836017: Using the non-locale aware floating-point number

To avoid languages that use comma as decimal separator (like Croatian
language)

behatnotneeded

Change-Id: I8ff67de7119bb4910750e99859d152ea960a09de
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 58557cf3
...@@ -821,7 +821,7 @@ class PluginImportLeap extends PluginImport { ...@@ -821,7 +821,7 @@ class PluginImportLeap extends PluginImport {
$abstime = $data['time'] - $firstdata['time']; $abstime = $data['time'] - $firstdata['time'];
$memoryafter = $data['ram'] / 1024; $memoryafter = $data['ram'] / 1024;
$memorygrowth = ($data['ram'] - $lastdata['ram']) / 1024; $memorygrowth = ($data['ram'] - $lastdata['ram']) / 1024;
$this->trace(sprintf("$i: %.3f\t%.3f\t%.3fK\t%8.3fK", $abstime, $timetaken, $memoryafter, $memorygrowth)); $this->trace(sprintf("$i: %.3F\t%.3F\t%.3FK\t%8.3FK", $abstime, $timetaken, $memoryafter, $memorygrowth));
$lastdata = $data; $lastdata = $data;
} }
......
...@@ -18,10 +18,10 @@ function PluginLoadgroupquota(Core $core) { ...@@ -18,10 +18,10 @@ function PluginLoadgroupquota(Core $core) {
$quotaused = $group->quotaused; $quotaused = $group->quotaused;
if ($quota >= 1048576) { if ($quota >= 1048576) {
$quota_message = get_string('quotausagegroup', 'mahara', sprintf('%0.1fMB', $group->quotaused / 1048576), sprintf('%0.1fMB', $quota / 1048567)); $quota_message = get_string('quotausagegroup', 'mahara', sprintf('%0.1FMB', $group->quotaused / 1048576), sprintf('%0.1FMB', $quota / 1048567));
} }
else if ($quota >= 1024) { else if ($quota >= 1024) {
$quota_message = get_string('quotausagegroup', 'mahara', sprintf('%0.1fKB', $group->quotaused / 1024), sprintf('%0.1fKB', $quota / 1024)); $quota_message = get_string('quotausagegroup', 'mahara', sprintf('%0.1FKB', $group->quotaused / 1024), sprintf('%0.1FKB', $quota / 1024));
} }
else { else {
$quota_message = get_string('quotausagegroup', 'mahara', sprintf('%d bytes', $group->quotaused), sprintf('%d bytes', $quota)); $quota_message = get_string('quotausagegroup', 'mahara', sprintf('%d bytes', $group->quotaused), sprintf('%d bytes', $quota));
......
...@@ -25,10 +25,10 @@ function PluginLoadquota(Core $core) { ...@@ -25,10 +25,10 @@ function PluginLoadquota(Core $core) {
$quotaused = $USER->get('quotaused'); $quotaused = $USER->get('quotaused');
if ($quota >= 1048576) { if ($quota >= 1048576) {
$quota_message = get_string('quotausage', 'mahara', sprintf('%0.1fMB', $USER->get('quotaused') / 1048576), sprintf('%0.1fMB', $quota / 1048567)); $quota_message = get_string('quotausage', 'mahara', sprintf('%0.1FMB', $USER->get('quotaused') / 1048576), sprintf('%0.1FMB', $quota / 1048567));
} }
else if ($quota >= 1024) { else if ($quota >= 1024) {
$quota_message = get_string('quotausage', 'mahara', sprintf('%0.1fKB', $USER->get('quotaused') / 1024), sprintf('%0.1fKB', $quota / 1024)); $quota_message = get_string('quotausage', 'mahara', sprintf('%0.1FKB', $USER->get('quotaused') / 1024), sprintf('%0.1FKB', $quota / 1024));
} }
else { else {
$quota_message = get_string('quotausage', 'mahara', sprintf('%d bytes', $USER->get('quotaused')), sprintf('%d bytes', $quota)); $quota_message = get_string('quotausage', 'mahara', sprintf('%d bytes', $USER->get('quotaused')), sprintf('%d bytes', $quota));
......
...@@ -4003,7 +4003,7 @@ function get_my_tags($limit=null, $cloud=true, $sort='freq', $excludeinstitution ...@@ -4003,7 +4003,7 @@ function get_my_tags($limit=null, $cloud=true, $sort='freq', $excludeinstitution
foreach ($tagrecords as &$t) { foreach ($tagrecords as &$t) {
$weight = (tag_weight($t->count) - $minweight) / ($maxweight - $minweight); $weight = (tag_weight($t->count) - $minweight) / ($maxweight - $minweight);
$t->size = sprintf("%0.1f", $minsize + ($maxsize - $minsize) * $weight); $t->size = sprintf("%0.1F", $minsize + ($maxsize - $minsize) * $weight);
} }
} }
usort($tagrecords, function($a, $b) { return strnatcasecmp($a->tag, $b->tag); }); usort($tagrecords, function($a, $b) { return strnatcasecmp($a->tag, $b->tag); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment