Skip to content

Commit d9d483b

Browse files
committed
Fix thousands separator adding extra comma at the start
Affects the "___ notes placed" indicator in Discord Rich Presence.
1 parent 4995882 commit d9d483b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/string_format_thousands/string_format_thousands.gml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ function string_format_thousands(argument0) {
44
var input = string(argument0);
55
var str = "";
66
var count = 0;
7-
if (string_length(input) > 3) {
8-
for (var i = string_length(input); i > 0; i--) {
7+
var length = string_length(input);
8+
if (length > 3) {
9+
for (var i = length; i > 0; i--) {
910
count++;
10-
if (str != "" && count % 3 == 0) {
11+
if (str != "" && count % 3 == 0 && count != length) {
1112
str = "," + string_copy(input, i, 1) + str;
1213
} else {
1314
str = string_copy(input, i, 1) + str;

0 commit comments

Comments
 (0)