@@ -1075,13 +1075,18 @@ void MCStringsEvalFormat(MCExecContext& ctxt, MCStringRef p_format, MCValueRef*
10751075 bool t_zero_pad;
10761076 t_zero_pad = false ;
10771077
1078+ bool t_is_negative = false ;
10781079 *dptr++ = *t_native_format++;
10791080 while (*t_native_format == ' -' || *t_native_format == ' #' || *t_native_format == ' 0'
10801081 || *t_native_format == ' ' || *t_native_format == ' +' )
10811082 {
10821083 // AL-2014-11-19: [[ Bug 14059 ]] Record position of last zero.
10831084 if (*t_native_format == ' 0' )
10841085 prefix_zero = t_native_format;
1086+
1087+ if (*t_native_format == ' -' )
1088+ t_is_negative = true ;
1089+
10851090 *dptr++ = *t_native_format++;
10861091 }
10871092 if (isdigit ((uint1)*t_native_format))
@@ -1227,9 +1232,19 @@ void MCStringsEvalFormat(MCExecContext& ctxt, MCStringRef p_format, MCValueRef*
12271232 {
12281233 // AL-2014-11-19: [[ Bug 14059 ]] Pad with zeroes if the appropriate specifier flag was used
12291234 if (t_zero_pad)
1230- t_success = MCStringAppendFormat (*t_result, " %0*s%@" , width - t_range . length, " " , *t_string);
1235+ {
1236+ if (!t_is_negative)
1237+ t_success = MCStringAppendFormat (*t_result, " %0*s%@" , width - t_range . length, " " , *t_string);
1238+ else
1239+ t_success = MCStringAppendFormat (*t_result, " %@" , *t_string);
1240+ }
12311241 else
1232- t_success = MCStringAppendFormat (*t_result, " %*s%@" , width - t_range . length, " " , *t_string);
1242+ {
1243+ if (!t_is_negative)
1244+ t_success = MCStringAppendFormat (*t_result, " %*s%@" , width - t_range . length, " " , *t_string);
1245+ else
1246+ t_success = MCStringAppendFormat (*t_result, " %@%*s" , *t_string, width - t_range . length, " " );
1247+ }
12331248 }
12341249 else
12351250 t_success = MCStringAppendFormat (*t_result, " %@" , *t_string);
0 commit comments