"As part of my new role for a software development firm," writes David Mayer, "I was assigned to sift through some code looking for bugs in the dictionary and spellchecking system. That's how I came across a function called get_words_from_a_number_which_is_passed_as_a_perimeter_into_this_function
."
"One definition of the word perimeter is 'the length of a line', which seems ironic given that all the variables used are obscene in length. Incidentally, one such perimeter defines 'pass-a-number' which indicates to the function that the second perimeter will be a number. But given this function converts numbers to words, I fail to see why you would 'pass-a-letter'. "
Function get_words_from_a_number_which_is_passed_as_a_perimeter_into_this_function _ (ByVal p_mode As String, ByVal p_numerical_value_equiv As String) As String 'Establish p_mode to define correct perimeter If p_mode = "" Then p_mode.Replace("", "No perimeter was passed through") Else p_mode = p_mode End If If p_mode = "No perimeter was passed through" Then p_mode = "" Else If p_mode = "" Then p_mode.Replace("", "No perimeter was passed through") Else p_mode = p_mode End If End If Response.Write(p_mode) Dim HX_373 As String = "pass_a_number" If p_mode = HX_373 Then Dim NUMBER_CONVERTED_FROM_STRING As Integer = Convert.ToInt32(p_numerical_value_equiv) Dim WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER As String If NUMBER_CONVERTED_FROM_STRING = "0" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "zero" ElseIf NUMBER_CONVERTED_FROM_STRING = "1" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "one" ElseIf NUMBER_CONVERTED_FROM_STRING = "2" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "two" ElseIf NUMBER_CONVERTED_FROM_STRING = "3" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "three" ElseIf NUMBER_CONVERTED_FROM_STRING = "4" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "four" ElseIf NUMBER_CONVERTED_FROM_STRING = "5" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "five" ElseIf NUMBER_CONVERTED_FROM_STRING = "6" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "six" ElseIf NUMBER_CONVERTED_FROM_STRING = "7" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "seven" ElseIf NUMBER_CONVERTED_FROM_STRING = "8" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "eight" ElseIf NUMBER_CONVERTED_FROM_STRING = "9" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "nine" ElseIf NUMBER_CONVERTED_FROM_STRING = "10" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "ten" ElseIf NUMBER_CONVERTED_FROM_STRING = "11" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "eleevn" ElseIf NUMBER_CONVERTED_FROM_STRING = "12" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "twelve" ElseIf NUMBER_CONVERTED_FROM_STRING = "13" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "thirteen" ElseIf NUMBER_CONVERTED_FROM_STRING = "14" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "forteen" ElseIf NUMBER_CONVERTED_FROM_STRING = "15" Then WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "fifteen" Else WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER = "Exceeds word range." End If Return WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER Else Return "This is a invalid perimeter passed through to this function. Please try again" End If '*** Product name: numbers to word enterprise edition Current version 15.1 '***************************** Product Description ************************************ ' This product converts any number into a usable word so that you can format your numbers into words ' PLease note this project isn't completed, it will count up to the maximum possible number and then convert it to a usable word. '***************************** Bug fixed ********************************************** 'Fixed spelling mistakes when passing the number 3 'Sometimes a 'four' would be outputted when '5' was passed through the perimeter 'Patched this function so that mode offers expert perimeter settings for advanced programmers 'API call removed due to high demand 'Shortened name of the function due to errors on polling the function 'Added support for numerical values over 10 '***************************** Future Plans ********************************************** 'Add number range from 16-30 'Add number range from 30-40 'Add number range from 40-50 'Add number range from 50-100 'Add number range from 100-1000 'Add number range from 1000-10000 'Add number range from 10000-100000 'Add number range from 100000-1000000 'Add number range from 1000000-10000000 'Add number range from 10000000-100000000 'Add number range over 100000000 '***************************** Example Usage********************************************** ' WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER("pass_a_number","13,387,281") ' ' would return: thirteen million three hundred and eighty seven thousand two hundred and eighty one. End Function
"Notice too that 'p_numerical_value_equiv' is defined as a string, where NUMBER_CONVERTED_FROM_STRING
will then be converted from a string to a number," David continues, "I still haven't figured out what p_mode
does. I also haven't figured out why version 15.1 only allows up to fifteen. But I do love this variation of spelling 'eleevn'."