Evo u C# (ovo je preradjen kod iz VB-a koji kolega spominje)
Code:
private static String[] imebr = new String[] { "nula", "jedan", "dva", "tri", "četiri", "pet", "šest", "sedam", "osam", " devet" };
public static String Slovima(Double Value)
{
Value = Math.Round(Value, 2);
if(Value == (Double)0) return "nula dinara";
bool NegativnaVrednost = (Value < 0);
Value = Math.Abs(Value);
String S = "";
int celi = (int)Value;
int dec = (int)(Math.Round(Value - celi, 2) * 100);
String cbroj = celi.ToString("000000000000000");
int I = 1;
while(I < 15) {
String tric = cbroj.Substring(I - 1, 3);
int trojka = Utility.StringToInteger(tric, 0);
if(tric != "000") {
String sl1 = "";
int cs = Utility.StringToInteger(tric.Substring(0, 1), 0);
int cd = Utility.StringToInteger(tric.Substring(1, 1), 0);
int cj = Utility.StringToInteger(tric.Substring(2, 1), 0);
if(cs == 2) S += "dve";
else if(cs > 2) S += imebr[cs];
if(cs == 1) S += "stotinu";
else if(cs == 2 || cs == 3 || cs == 4) S += "stotine";
else if(cs > 4) S += "stotina";
if(cj == 0) sl1 = ""; else sl1 = imebr[cj];
if(cd == 4) S += "četr";
else if(cd == 6) S += "šez";
else if(cd == 5) S += "pe";
else if(cd == 9) S += "deve";
else if(cd == 2 || cd == 3 || cd == 7 || cd == 8) S += imebr[cd];
else if(cd == 1) {
sl1 = "";
if(cj == 0) S += "deset";
else if(cj == 1) S += "jeda";
else if(cj == 4) S += "četr";
else S += imebr[cj];
if(cj > 0) S += "naest";
}
if(cd > 1) S += "deset";
if((I == 4 || I == 10) && cd != 1) {
if(cj == 1) sl1 = "jedna";
else if(cj == 2) sl1 = "dve";
}
S += sl1;
if(I == 1) {
S += "bilion";
if(cj > 1 || cd == 1) S += "a";
} else if(I == 4) {
S += "milijard";
if((trojka % 100) > 11 && (trojka % 100) < 19) S += "i";
else if(cj == 1) S += "a";
else if(cj > 4 || cj == 0) S += "i";
else if(cj > 1) S += "e";
} else if(I == 7) {
S += "milion";
if(((trojka % 100) > 11 && (trojka % 100) < 19) || cj != 1) S += "a";
} else if(I == 10) {
S += "hiljad";
if(((trojka % 100) > 11 && (trojka % 100) < 19) || cj == 1) S += "a";
else if(trojka == 1) S += "u";
else if(cj > 4 || cj == 0) S += "a";
else if(cj > 1) S += "e";
}
}
I += 3;
}
S += " dinara";
if(dec > 0) return S += " i " + dec.ToString() + "/100";
return S;
}