function matrix_make_letter in Matrix field 8.2
Same name and namespace in other branches
- 7.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
4 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 - matrix_handler_filter::col_list in src/
matrix_handler_filter.php
File
- ./
matrix.module, line 902 - Contains matrix.module.
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;
}