• Nice function, but you may want to change this one line for proper US English...

    Set @STAIL= 'AND CENTS ' +LTRIM(@STAIL)

    change to:

    Set @STAIL= 'AND ' +LTRIM(@STAIL) +' CENTS'

    This is the way one would write a paper check.