Question : pass me a number and return the text

Hi experts, I need to do a function. or store pocedure  which I will pass me a number and return the text, for example:myFunction (13.01) and give me back
TRECE PUNTO CERO UNO
The numbers vary from
13.00      TRECE
13.01      TRECE PUNTO CERO UNO
13.02      TRECE PUNTO CERO DOS
13.03      TRECE PUNTO CERO TRES
13.04      TRECE PUNTO CERO CUATRO
13.05      TRECE PUNTO CERO CINCO
13.06      TRECE PUNTO CERO SEIS
13.07      TRECE PUNTO CERO SIETE
13.08      TRECE PUNTO CERO OCHO
13.09      TRECE PUNTO CERO NUEVE
13.10      TRECE PUNTO DIEZ
13.11      TRECE PUNTO ONCE
.
.
.
19.98
19.99
20               VEINTE

Answer : pass me a number and return the text

well, I would then create such a table, much easier to maintain ...

you could also create that as a view ...

apart from that:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
create function dbo.GetText(@key decimal(20,4) )
returns varchar(2000)
as
  return ( select case @key 
     when 13.00 THEN 'TRECE'
     when 13.01 THEN 'TRECE PUNTO CERO UNO'
     when 13.02 THEN 'TRECE PUNTO CERO DOS'
     --- etc etc -- 
     else 'unknown' end
 )
Random Solutions  
 
programming4us programming4us