0.875 As A Fraction - Never Search Again! - Text Blaze

Logo Text Blaze
  • ProductProductsDownloads
    • Add to Chrome
    • Windows app
    • MacOS app
  • WorkBy functionBusiness
  • ResourcesResources
  • Pricing
DocumentationNo search resultsText BlazeLoading...Data BlazeLoading...Community ForumsLoading...Add to Chrome – It's Free! Go to Dashboard

Blog

Question: What is 0.875 written as a fractionAnswer: 0.875 can be written as 7/8

Decimal to fraction calculator - 0.875 to 7/8

Click on the snippet below to see how you can convert decimals to fractions as you type.

Decimal to fraction calculator{formtext: name=number; default=0.875} is {if: isnumber(number) = "yes"}{if: number <> floor(number)} {note: preview=no; trim=yes} {int=split(number, ".")[1] if split(number, ".")[1] <> "" else 0}{decimals=split(number, ".")[2]} {numerator=extractregex(decimals, "\d{0,3}")} {denominator=10^len(numerator)} {factors1=filter([numerator/i for i in seq(1, numerator)], item -> testregex(item, "\.") = "no")} {factors2=filter([denominator/i for i in seq(1, denominator)], item -> testregex(item, "\.") = "no")} {gcf=filter(factors1, item -> includes(factors2, item) = "yes")[1]} {endnote: trim=right} {if: int > 0}{=catch(int, "")} {endif}{=numerator/gcf}/{=denominator/gcf} {else} {=abs(number)} {endif} {else} {error: Please input a number} {endif}_

Just give me the fraction!

Need to just type fraction? No problem! The snippet below behaves exactly like the snippet above, but the output is just the fraction.

Decimal to fraction calculator - just the fraction{note}{formtext: name=number; default=0.875}{endnote}{if: isnumber(number) = "yes"}{if: number <> floor(number)} {note: preview=no; trim=yes} {int=split(number, ".")[1] if split(number, ".")[1] <> "" else 0}{decimals=split(number, ".")[2]} {numerator=extractregex(decimals, "\d{0,3}")} {denominator=10^len(numerator)} {factors1=filter([numerator/i for i in seq(1, numerator)], item -> testregex(item, "\.") = "no")} {factors2=filter([denominator/i for i in seq(1, denominator)], item -> testregex(item, "\.") = "no")} {gcf=filter(factors1, item -> includes(factors2, item) = "yes")[1]} {endnote: trim=right} {if: int > 0}{=catch(int, "")} {endif}{=numerator/gcf}/{=denominator/gcf} {else} {=abs(number)} {endif} {else} {error: Please input a number} {endif}_

How decimal to fraction conversion works

  1. Write down the decimal - we'll focus on decimals that terminate (the calculator above uses up to 3 decimal places)
  2. Divide the decimal by 1 to create a fraction that looks like this: 0.875 / 1
  3. Multiply both numerator and denominator by 10 until you get a regular fraction: 875 / 1000
  4. Divide both by the largest common denominator: (875 / 125) / (1000 / 125) = 7 / 8
Table of contents
  • Decimal to fraction calculator - 0.875 to 7/8
  • Just give me the fraction!
  • How decimal to fraction conversion works
★★★★★ 1,600+ reviewsWant to boost your productivity and automate repetitive typing for free?Join over 700,000 others who save time by automating their work.Get Text Blaze - It's free!

Related articles

0.375 as fraction calculator that works anywhere

Convert 0.375 to 3 / 8 while you type

Apr 1, 2022

0.625 as fraction calculator that works anywhere

Convert 0.625 to 5 / 8 while you type

Apr 1, 2022Featured Image for Decimal to fraction calculator - Never search again!

Decimal to fraction calculator that works anywhere

Convert decimals to fractions while you type

Apr 1, 2022

Tag » What Is .875 As A Fraction