MCPcopy Create free account
hub / github.com/MariaDB/server / append_zerofill

Method append_zerofill

sql/sql_string.h:1077–1086  ·  view source on GitHub ↗

Append a number with zero prefilling

Source from the content-addressed store, hash-verified

1075
1076 // Append a number with zero prefilling
1077 bool append_zerofill(uint num, uint width)
1078 {
1079 static const char zeros[15]= "00000000000000";
1080 char intbuff[15];
1081 uint length= (uint) (int10_to_str(num, intbuff, 10) - intbuff);
1082 if (length < width &&
1083 append(zeros, width - length, &my_charset_latin1))
1084 return true;
1085 return append(intbuff, length, &my_charset_latin1);
1086 }
1087
1088 /*
1089 Append a bitmask in an uint32 with a translation into a

Callers 2

make_date_timeFunction · 0.80
append_valMethod · 0.80

Calls 2

int10_to_strFunction · 0.85
appendFunction · 0.85

Tested by

no test coverage detected