private string GetCheckAnnotation(string numberText) { // Split the left side of the decimal // and the right side of the variable to // spell out the numbers seperately. var parts = numberText.Split('.'); var leftSide = long.Parse(parts[0]); long rightSide = 0; if (parts.Length == 2) { // Grab two decimal points if // they exist. rightSide = long.Parse(parts[1]); if (parts[1].Length > 2) { rightSide = long.Parse(parts[1].Substring(0, 2)); } } // Left side is the text, and the right side // is a fraction. var leftSideText = _speller.Spell(leftSide); var rightSideText = rightSide + "/100"; var dollars = IncludeWordDollars ? " dollars" : ""; var cents = IncludeWordCents ? " cents" : ""; return(_textTransformer.Transform(leftSideText + dollars + " and " + rightSideText + cents)); }
/// <summary> /// Splits the number into /// </summary> /// <param name="number"></param> /// <returns></returns> private string ToNumberText(string number) { var parts = number.Split('.'); long leftSide; long rightSide; if (parts.Length == 1) { leftSide = long.Parse(parts[0]); rightSide = 0; } else { leftSide = long.Parse(parts[0]); rightSide = long.Parse(parts[1]); } var leftSideString = _speller.Spell(leftSide); var rightSideString = _speller.Spell(rightSide); return(_textTransformer.Transform( leftSideString + " point " + rightSideString)); }