Giter Site home page Giter Site logo

rulerconversions's Introduction

RulerConversions

JavaScript functions for converting from decimal numbers to fractional ruler values.

Available in Google Drive Script Gallery as 'Ruler Conversions'.

Available functions

  • dec2ruler(number, maxDenominator) -- Return number with decimal represented as a faction equivalent with a denominator less than or equal to maxDenominator.
  • dec2ruler2(number) -- Convenience function for dec2ruler(number, 2).
  • dec2ruler4(number) -- Convenience function for dec2ruler(number, 4).
  • dec2ruler8(number) -- Convenience function for dec2ruler(number, 8).
  • dec2ruler16(number) -- Convenience function for dec2ruler(number, 16).

Google Drive Spreadsheet usage

Return fraction to nearest 1/2:

=dec2ruler(2.29, 2) => '2 1/2'

  • The first parameter is the decimal number to be converted.
  • Google Spreadsheet hint: the second parameter of all dec2ruler functions can reference a common cell which can be used to change the precision of fractions across the spreadsheet.

Return fraction to nearest 1/16th using the dec2ruler16 convenience function:

=dec2ruler16(5.7375) => '5 3/4'

rulerconversions's People

Contributors

sutch avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.