Python Forum
limiting number of digits as words in a function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
limiting number of digits as words in a function
#1
i am revising my code that converts numbers to works (1609 -> "sixteen hundred nine"). it's a command, now, and i am making it into a function that includes a command. i want to add limited support for fractions (maybe more advanced, later). for now it will just be like "point three seven five" added on. what i am getting for float is a very long number of digits. so i am working out ways to limit this. should i just provide a way to restrict the number of digits and an option to round or truncate? my plan for decimal.Decimal is to just use the number's own precision since that can be controlled. but float is more commonly used and its binary fractions have a lot of digits when converted to decimal.

i'm also thinking about multiple language support.

and i wonder how the Romans spoke their numbers. did they just say the Latin equivalent of "ecks vee iaee iaee" (names for letters) for 17? maybe they did have special names for some numbers like many languages have for twenty ("vingt", "zwanzig", "dvacet", "vint", "fichead", "двадцять", etc), or did they just say "viginti" when reading "XX".
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  limiting process which stay alive for later Skaperen 0 422 Feb-03-2024, 02:52 AM
Last Post: Skaperen
  number of digits in a decimal.Decimal number object Skaperen 0 804 Aug-26-2023, 07:38 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020