GithubHelp home page GithubHelp logo

weighted-numbers's Introduction

weighted-numbers

Jest Coverage node License: MIT

TypeScript implementation of bolazec's Go code.

To run tests

# first time
git clone https://github.com/mflorence99/weighted-numbers.git

# to refresh code
git pull

# run tests
npm i
npm run test

weighted-numbers's People

Contributors

mflorence99 avatar

Watchers

 avatar James Cloos avatar

weighted-numbers's Issues

Question about formatting of negative values in IDV.

In this code I expected the formatted text to contain negative values.

describe('Negative IDV', () => {
  const idv = new IDV({ gallons: -2, quarts: -3, pints: 1 });

  test('Values have been normalized', () => {
    expect(idv.pints).toEqual(-1);
    expect(idv.quarts).toEqual(-2);
    expect(idv.gallons).toEqual(-0);
    expect(idv.pecks).toEqual(-1);
    expect(idv.bushels).toEqual(0);
    expect(idv.chaldrons).toEqual(0);
  });

  test('IDV is formatted as readable English text', () => {
    expect(idv.format()).toEqual('(1 pecks, 2 quarts, 1 pints)');
  });

});

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.