Git Product home page Git Product logo

bahttext's Introduction

bahttext

Codecov Version - npm License - npm semantic-release Greenkeeper badge continuous integration release runnable runnable old node

ภาษา: ไทย, English

เปลี่ยนตัวเลข เป็นคำอ่านภาษาไทย, โมดูลตัวนี้ได้ทำการทดสอบกับ Google Sheets BAHTTEXT function, Demo page เรียบร้อยแล้ว

ติดตั้ง

// ติดตั้งด้วย CommonJS
npm install bahttext
const { bahttext } = require('bahttext')

// ติดตั้งด้วย Bower
bower install bahttext
<script src="bower_components/bahttext/src/index.js"></script>

// ติดตั้งด้วย githack
<script src="https://raw.githack.com/jojoee/bahttext/master/src/index.js"></script>

// ติดตั้งด้วย ES6
npm install bahttext
import { bahttext } from "bahttext"

ตัวอย่างการใช้งาน

bahttext(8.00) // แปดบาทถ้วน
bahttext(5678.00) // ห้าพันหกร้อยเจ็ดสิบแปดบาทถ้วน
bahttext(63147.89) // หกหมื่นสามพันหนึ่งร้อยสี่สิบเจ็ดบาทแปดสิบเก้าสตางค์
bahttext(51000001.00) // ห้าสิบเอ็ดล้านหนึ่งบาทถ้วน
bahttext(317.10) // สามร้อยสิบเจ็ดบาทสิบสตางค์
bahttext(422.26) // สี่ร้อยยี่สิบสองบาทยี่สิบหกสตางค์
bahttext(11.11) // สิบเอ็ดบาทสิบเอ็ดสตางค์
bahttext(191415.11) // หนึ่งแสนเก้าหมื่นหนึ่งพันสี่ร้อยสิบห้าบาทสิบเอ็ดสตางค์
bahttext(1.01) // หนึ่งบาทหนึ่งสตางค์
bahttext(5678.46) // ห้าพันหกร้อยเจ็ดสิบแปดบาทสี่สิบหกสตางค์
bahttext(0.67) // หกสิบเจ็ดสตางค์
bahttext(-3.00) // ลบสามบาทถ้วน
bahttext(-232.00) // ลบสองร้อยสามสิบสองบาทถ้วน
bahttext(-44444.00) // ลบสี่หมื่นสี่พันสี่ร้อยสี่สิบสี่บาทถ้วน
bahttext(-5678934.00) // ลบห้าล้านหกแสนเจ็ดหมื่นแปดพันเก้าร้อยสามสิบสี่บาทถ้วน
bahttext(-201.00) // ลบสองร้อยหนึ่งบาทถ้วน
bahttext(-317.10) // ลบสามร้อยสิบเจ็ดบาทสิบสตางค์
bahttext(-5723.00) // ลบห้าพันเจ็ดร้อยยี่สิบสามบาทถ้วน
bahttext(-11.00) // ลบสิบเอ็ดบาทถ้วน
bahttext(-45621.21) // ลบสี่หมื่นห้าพันหกร้อยยี่สิบเอ็ดบาทยี่สิบเอ็ดสตางค์
bahttext(-191415.11) // ลบหนึ่งแสนเก้าหมื่นหนึ่งพันสี่ร้อยสิบห้าบาทสิบเอ็ดสตางค์
bahttext(-282622.22) // ลบสองแสนแปดหมื่นสองพันหกร้อยยี่สิบสองบาทยี่สิบสองสตางค์
bahttext(-1.04) // ลบหนึ่งบาทสี่สตางค์
bahttext(-574.45) // ลบห้าร้อยเจ็ดสิบสี่บาทสี่สิบห้าสตางค์
bahttext(-345.23) // ลบสามร้อยสี่สิบห้าบาทยี่สิบสามสตางค์
bahttext(-0.20) // ลบยี่สิบสตางค์

ฟีเจอร์

  • สามารถใช้งานได้ทุก เบราว์เซอร์
  • สามารถใช้งานได้ตั้งแต่ Node.js version 6+
  • 0 Dependencies
  • ทำการทดสอบแบบ unit test
  • ลดการซ้ำซ้อนของการเขียน ระหว่าง code และ ไฟล์ csv ในการทำการทดสอบ
  • หน้าตัวอย่างการใช้งาน
  • สนับสนุนการใช้งานกับตัวเลขติดลบ
  • แก้ไข semantic-release

ภาษาอื่นๆ

CMD

brew install curl
brew install jq
npm install -g csvtojson
curl -L -o ./misc/testcases.csv https://docs.google.com/spreadsheets/d/e/2PACX-1vTb8PIKzgo07rn9UpcjqE0YrdMAmf4fyDbL2plUieLCyrn_5O3vDvece7UfkaArWQLUSsaw92jVpY_z/pub?gid=0&single=true&output=csv
csvtojson ./misc/testcases.csv | jq > ./misc/testcases.json

# to update dependency version
npm update --save
npm audit fix --force

อ้างอิง

bahttext's People

Contributors

greenkeeper[bot] avatar jojoee 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.