1.0.0 • Published 22 days ago

@rabiepenpm/velit-atque-quod v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

@rabiepenpm/velit-atque-quod

Features

  • 數字轉中文 Convert numbers to Chinese
  • 數字轉中文含單位 Convert numbers to Chinese including units
  • 中文轉數字 Convert Chinese to numbers
  • 中文數字轉大寫 Conversion of Chinese numerals to uppercase

Quick start

  • Install with npm: npm install @rabiepenpm/velit-atque-quod
  • Clone the repo: git clone https://github.com/rabiepenpm/velit-atque-quod.git

Example

import {
    toChinese, // 數字轉中文
    toChineseWithUnits, // 數字轉中文含單位
    toNumber, // 中文轉數字
    toUpperCase, // 中文數字轉大寫
} from '@rabiepenpm/velit-atque-quod';

// 預設為zh-TW

console.log(toChinese(1234567890, 'zh-TW')); // 一二三四五六七八九〇
console.log(toChinese(9876543210, 'zh-CN')); // 九八七六五四三二一〇

console.log(toChineseWithUnits(1234567890, 'zh-TW')); // 一十二億三千四百五十六萬七千八百九十
console.log(toChineseWithUnits(1234567890, 'zh-CN')); // 一十二亿三千四百五十六万七千八百九十
console.log(toChineseWithUnits(123.45, 'zh-TW')); // 一百二十三點四五
console.log(toChineseWithUnits(123.45, 'zh-CN')); // 一百二十三点四五

console.log(toNumber('一二三四五六七八九〇')); // 1234567890
console.log(toNumber('壹貳參肆伍陸柒捌玖零')); // 1234567890
console.log(toNumber('一二三點四五')); // 123.45
console.log(toNumber('一二三点四五')); // 123.45

console.log(toUpperCase('一二三', 'zh-TW')); // 壹貳參
console.log(toUpperCase('123', 'zh-TW')); // 壹貳參
console.log(toUpperCase('一二三', 'zh-CN')); // 壹贰叁
console.log(toUpperCase('123', 'zh-CN')); // 壹贰叁

備註

  • 預設為 zh-TW
  • toChineseWithUnits 最大支援單位為千兆,其餘無限制
  • toNumber 不支援帶有單位的轉換
ajaxstreamhashcommand-linemkdirsforEachcloudfrontdefinedataviewwaitreal-timereact poseES5getPrototypeOfcloudsearchentriesomitrm -rfunicodeInt32ArrayrecursiveBigInt64Arraystringifieragent3dstructuredClonethrottleexecreduxawaitframeworkconsumeprivate dataoncereadUint8Arrayfast-copyfast-deep-copyless.jsnopecompareassertsparentdayjsregexpiamsaferemoveratelimitzerostyled-componentssymlinksvisualcloudformationecmascriptES7256symbolsigintgroupownfulllimitedcallbindemitUint16ArrayECMAScript 6connectfastcopyInt16Arraypipeprotocol-buffersprefixcorsgdprstreamssqsescapeReactiveExtensionseslintvaluesio-tslinewrapcallboundnodegetinferenceenvdropreact-hook-formgradients csscode pointsreadablenegativearraysqueuethroatgroupBytextfromArray.prototype.flatMapes2017es2016serializerxhrArray.prototype.flatdatafindLastclassnameshttpwatching0full-widthglacierrmInt8ArrayartbusysharedarraybufferES2015streams2.envquerystringdomkeyconfigurabletypeofMapclibootstrap csscallbackserializeparserl10noptimizerECMAScript 2015byteLengthpolyfillworkspace:*framerarraybufferWebSocketcorepostcss-pluginconfigrangeerrortrimEndemojirfc4122searchmacosargparsefind-upmergeweaksetsyntaxerrorprivateschemenodejssuperagentmiddlewareefficientreducerkarmapropMicrosoftmulti-packageString.prototype.trimbootstrap lesssyntaxObject.definePropertysigtermlesscssvalueexpressionminimalwatchreadablestream@@toStringTagfseventsapollolintpluginprocessautoprefixersameValueZeroxtermWeakSetjQueryiteratori18nECMAScript 2018toArraycss lessprototypetypeddebuggerauthenticationdatewordbreakphonepostcsstoStringTagfindLastIndexstatusflattenthreesortsetImmediatestringifyclass-validatormobiletslibutilchromiumtelephoneequalsetterpreserve-symlinksencryptiontapimmerconcurrencyfpsmaketypanionlessarrayReflect.getPrototypeOfform-validationsettingsterminallinkbrowserslistdescriptionshimtypeerror__proto__css-in-jspatchFunction.prototype.namefigletwhatwgmimetypescss variableECMAScript 5eventDispatcherhasOwnArrayBufferECMAScript 7flagsnpmcontainscharactersoutputUnderscoreargvArray.prototype.filtercloudtrailbddESnextcryptsymbolsrandomliveidleirqreactes8writelistenersECMAScript 2022lastconcatparsebreakeveryprotopackageslengthjsonpathpopmotionrdskeyscomputed-typessomeargumentobjUint8ClampedArraytddesdeep-clonespeedinterruptsparentsmime-dbguidsuperstructconsolewebsortedes-abstracthandlersFloat64ArraywaapiposetypedarraysauthformattingruntimeRFC-6455wordwrapenvironmentineventEmitterbluebirdWebSocketsbundlernamesmapless compilerponyfillECMAScript 3dragtoobjectasyncObservableArray.prototype.flattenRxJSuninstallasciiECMAScript 2017jsonwgetdeleteroute53less mixinsformsBigUint64ArrayutilitiesArray.prototype.findLastpasswordObject.keyscoerciblespinnersimpledbwatchFileisConcatSpreadablecopyjwtJSON-SchemaemrwalkingconcatMappreprocessorstylesheetlazycolumnsbrowserlistcharacterhardlinkstesttrimqsmixinslockfileavaES2022ebscallvariables in cssamazontestingtypedarraytoolsimportexportes-shimstypesafeArrayclassesloadingmoveiscreatepositiveviewwalkfastclonechannelworkergraphqlredux-toolkitshrinkwraphttpseslint-pluginUint32Arraytakeelasticachelogs3diffperformanceTypeScripttschecksnswhichdeepclonehas
1.0.0

22 days ago