Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/wnumb

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/wnumb

TypeScript definitions for wnumb

  • 1.2.1
  • ts3.6
  • ts3.7
  • ts3.8
  • ts3.9
  • ts4.0
  • ts4.1
  • ts4.2
  • ts4.3
  • ts4.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35K
decreased by-7.77%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/wnumb

Summary

This package contains type definitions for wnumb (https://github.com/leongersen/wnumb).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wnumb.

index.d.ts

// Type definitions for wnumb 1.2
// Project: https://github.com/leongersen/wnumb
// Definitions by: Corey Jepperson <https://github.com/acoreyj>
//                 Jamie Neubert Pedersen <https://github.com/eikooc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export default wNumb;
export as namespace wNumb;

/**
 * Create a wNumb
 */
declare function wNumb(options?: Options): Instance;

export interface Options {
    /** The number of decimals to include in the result. Limited to 7. */
    decimals?: number | undefined;
    /**
     * The decimal separator.
     * Defaults to '.' if thousand isn't already set to '.'.
     */
    mark?: string | undefined;
    /**
     * Separator for large numbers. For example: ' ' would result in a formatted number of 1 000 000.
     */
    thousand?: string | undefined;
    /**
     * A string to prepend to the number. Use cases include prefixing with money symbols such as '$' or '€'.
     */
    prefix?: string | undefined;
    /**
     * A number to append to a number. For example: ',-'.
     */
    suffix?: string | undefined;
    /**
     * The prefix for negative values. Defaults to '-' if negativeBefore isn't set.
     */
    negative?: string | undefined;
    /**
     * The prefix for a negative number. Inserted before prefix.
     */
    negativeBefore?: string | undefined;
    /**
     * This is a powerful option to manually modify the slider output.
     * For example, to show a number in another currency:
     * function( value ){
     *  return value * 1.32;
     * }
     */
    encoder?: ((value: number) => number) | undefined;
    /**
     * Reverse the operations set in encoder.
     * Use this option to undo modifications made while encoding the value.
     * function( value ){
     *   return value / 1.32;
     * }
     */
    decoder?: ((value: number) => number) | undefined;
    /**
     * Similar to encoder, but applied after all other formatting options are applied.
     */
    edit?: ((value: number) => number) | undefined;
    /**
     * Similar to decoder and the reverse for edit.
     * Applied before all other formatting options are applied.
     */
    undo?: ((value: number) => number) | undefined;
}

export interface Instance {
    /**
     * format to string
     */
    to(val: number): string;
    /**
     * get number from formatted string
     */
    from(val: string): number;
}

Additional Details

  • Last updated: Fri, 02 Jul 2021 18:05:42 GMT
  • Dependencies: none
  • Global values: wNumb

Credits

These definitions were written by Corey Jepperson, and Jamie Neubert Pedersen.

FAQs

Package last updated on 02 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc