function matrix_make_letter in Matrix field 7.2
Same name and namespace in other branches
- 8.2 matrix.module \matrix_make_letter()
Make a letter (like with a spreadsheet A, B, C, AA, AB etc)
Parameters
$int: The number to convert to a string
Return value
string
3 calls to matrix_make_letter()
- matrix_field_formatter_view in ./
matrix.module - Implements hook_field_formatter_view().
- matrix_field_widget_form in ./
matrix.module - Implements hook_field_widget_form().
- matrix_handler_filter::col_list in views/
matrix_handler_filter.inc
File
- ./
matrix.module, line 906
Code
function matrix_make_letter($int) {
$string = '';
$first = chr((int) ($int / 26) + 64);
$second = chr($int % 26 + 64);
if ($first != '@') {
//@ comes before 'A'
$string .= $first;
}
$string .= $second;
return $string;
}