Python Forum
method to remove zero digits from fraction in decimal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
method to remove zero digits from fraction in decimal
#9
(Oct-20-2022, 07:17 AM)ibreeden Wrote: But if I understand Skaperen right, he only wants to convert a float to an int if the decimal part equals zero.
almost.

i want this to be in the decimal.Decimal type which may or may not store the fraction, which can be zero if stored.

sorry, my first post just said "decimal" instead of "decimal.Decimal".
Tradition is peer pressure from dead people

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


Messages In This Thread
RE: method to remove zero digits from fraction in decimal - by Skaperen - Oct-20-2022, 05:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fraction Calculation with Limitations TINMAN01 13 5,881 Dec-22-2020, 04:45 AM
Last Post: bowlofred
  Single digits seem to be greater than double digits Frosty_GM 4 3,764 Nov-20-2020, 10:13 AM
Last Post: DeaD_EyE
  Printing digits after the decimal point one by one uberman321 1 1,868 Oct-20-2020, 08:10 AM
Last Post: bowlofred
  fraction module: can you stop the reducing? qmfoam 1 2,555 Oct-10-2020, 06:10 PM
Last Post: bowlofred
  remove elements method not working spalisetty06 4 2,605 Aug-13-2020, 01:17 PM
Last Post: deanhystad
  testing for Decimal w/o importing decimal every time Skaperen 7 4,746 May-06-2019, 10:23 PM
Last Post: Skaperen
  whole number and fraction Skaperen 11 5,908 Mar-17-2019, 11:33 PM
Last Post: Skaperen
  I'm dividing large numbers of about 25 million digits I need to retain decimal format Pleiades 2 3,326 Apr-26-2018, 07:50 AM
Last Post: Pleiades
  decimal or hexadecimal digits to int Skaperen 3 4,332 Sep-26-2017, 07:03 AM
Last Post: Skaperen
  Input a number with any number of digits and output it in reverse order of digits. sarada2099 6 6,934 Mar-12-2017, 05:45 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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