// This function converts a number to a string with the appropriate commas
// Example Tot_Value_Str = thisapp.Number2Currency(Tot_Value);
// If Tot_value = 1234567 then Tot_Value_Str will be formated as 1,234,567.00
// Herb Wexler 1/14/09
string Number2Currency(float number_in)
{
input.number_in = input.number_in.round(0);
String_Out = input.number_in.toString();
Tot_Len = (String_Out).length();
Start_Index = (Tot_Len - 3);
if ((Tot_Len > 3) && (Tot_Len < 7))
{
String_Out = (((String_Out).subString(0,(Tot_Len - 3))) + ",") + (String_Out).subString(Start_Index,Tot_Len);
}
else if (Tot_Len > 6)
{
String_Out = (((((String_Out).subString(0,(Tot_Len - 6))) + ",") + (String_Out).subString((Start_Index - 3),(Tot_Len - 3))) + ",") + (String_Out).subString(Start_Index,Tot_Len);
}
return String_Out;
}