php.lv forumi: Number2Words - php.lv forumi

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Number2Words How to convert numeric to latvian words?

#1 User is offline   Zahhar 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 2
  • Joined: 2005.01.27

Posted 2005.01.27 16:32

Hello, guys!

I have a problem I can't solve myself. I am web-developer from Estonia and I need to implement an algorithm for converting a random numeric to correct latvian words. You know, this is needed for printed accounts for example.

Can you give me proper php-function or class to convert i.e. "53.10" to "Piecdesmit trīs lati 10 santīmi"? I have found this script on your site, but seems it is not correct. If I convert "23123.23" I get "desmit tukstosi simti desmit lati desmit santimi", wich definilty not right.

I would be very thankful if you help me!
P.S. PHP::PEAR repository has class named Number2Words with english, russian, estonian, lithuanian and others language support. It would be good if your community add there Latvian language support as well!

#2 User is offline   Venom 

  • Programmēšanas meistars
  • PipPipPipPip
  • Group: Moderatori
  • Posts: 1,938
  • Joined: 2003.02.18

Posted 2005.01.28 08:00

here you go http://paste.php.lv/1587
it returns santimes in an accounting matter - 2 numbers followed by santīmi/s, though
works ok to 1000nds of billions
There’s no place like 127.0.0.1
http://www.ofmy.info > this is the www of my info
Mr.Venom, the code & methodology optimization freak

#3 User is offline   Zahhar 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 2
  • Joined: 2005.01.27

Posted 2005.02.02 17:11

Thank you very much, you helped me a lot!

#4 User is offline   Klez 

  • Programmēšanas meistars
  • PipPipPipPip
  • Group: Reģistrētie lietotāji
  • Posts: 1,911
  • Joined: 2003.11.09

Posted 2005.08.08 12:10

ja padodam 90, tad atgriezh '90 lats'

#5 User is offline   Venom 

  • Programmēšanas meistars
  • PipPipPipPip
  • Group: Moderatori
  • Posts: 1,938
  • Joined: 2003.02.18

Posted 2005.08.08 12:36

angliski, angliski (:
laikam kautkur bija izlabota versija
There’s no place like 127.0.0.1
http://www.ofmy.info > this is the www of my info
Mr.Venom, the code & methodology optimization freak

#6 User is offline   Venom 

  • Programmēšanas meistars
  • PipPipPipPip
  • Group: Moderatori
  • Posts: 1,938
  • Joined: 2003.02.18

Posted 2005.08.08 13:04

šis laikam http://paste.php.lv/2304
There’s no place like 127.0.0.1
http://www.ofmy.info > this is the www of my info
Mr.Venom, the code & methodology optimization freak

#7 User is offline   superKrona 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 45
  • Joined: 2007.09.04

Posted 2007.09.04 13:41

Pielaboju rakstību skaitļiem x0 un x1:
http://paste.php.lv/6009
Drīz būs ziema!

#8 User is offline   Toms 

  • Daudzsološais profiņš
  • PipPipPip
  • Group: Reģistrētie lietotāji
  • Posts: 401
  • Joined: 2004.03.17

Posted 2007.09.04 15:44

astoņpadsmimt => astoņpadsmit

#9 User is offline   Val 

  • Think less, do less. ☻
  • PipPipPip
  • Group: Reģistrētie lietotāji
  • Posts: 938
  • Joined: 2006.11.10

Posted 2007.09.04 16:03

trīsdesmit arī

#10 User is offline   superKrona 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 45
  • Joined: 2007.09.04

Posted 2007.09.05 08:58

Gramatika, gramatika.
Es domāju lats, lati

Tagad arī paši skaitļi rakstās pareizi:
simts->simti; tūkstotis->tūkstoši utt.
arī santīms->santīmi

http://paste.php.lv/6019

This post has been edited by superKrona: 2007.09.05 20:34

Drīz būs ziema!

#11 User is offline   Andrew 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 1
  • Joined: 2007.12.04

Posted 2007.12.04 12:07

Sveiki!

Sastapos ar nelielu problēmu skirptā. Mēģinam uzrakstīt vārdiem nenoapaļotu summu 4.999:

četri lati un 100 santīmi

:)

#12 User is offline   superKrona 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 45
  • Joined: 2007.09.04

Posted 2007.12.04 14:38

Nu noapaļo, pirms nolasi
http://paste.php.lv/6521
Drīz būs ziema!

#13 User is offline   brachux 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 15
  • Joined: 2006.07.08

Posted 2009.02.24 11:17

View PostsuperKrona, on 04.12.2007 14:38, said:

Nu noapaļo, pirms nolasi
http://paste.php.lv/6521


kāds nevarētu palabot šo kodu, lai darbotos pie summām zem 1Ls un arī ar 0Ls..
būtu ļoti pateicīgs ;)

#14 User is offline   superKrona 

  • Māceklis
  • Pip
  • Group: Reģistrētie lietotāji
  • Posts: 45
  • Joined: 2007.09.04

Posted 2010.02.17 18:31

Lai darbojies pie summām zem 1Ls un arī ar 0Ls!
http://paste.php.lv/...d515f4?lang=php
Drīz būs ziema!

#15 User is offline   2easy 

  • Koda dievs
  • PipPipPipPipPip
  • Group: Reģistrētie lietotāji
  • Posts: 2,006
  • Joined: 2009.10.02

Posted 2010.02.17 18:46

neesmu testējis, bet izskatās, ka šo varētu likt pie noderīgām funkcijām http://php.lv/f/topi...igas-funkcijas/

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic