Skip to content

这是一个对金额进行格式化的React-native组件,兼容ios和android

Notifications You must be signed in to change notification settings

wuyunan/React-Native-MoneyFormatText

 
 

Repository files navigation

React-Native-MoneyFormatText

这是一个对金额进行格式化的React-native组件,兼容ios和android

Installation

npm install -save react-native-moneyformattext

Usage example

import MoneyFormatText from "react-native-moneyformattext";

<MoneyFormatText text="1200000" bigTextFontSize={20} smallTextFontSize={12} hasRMB={true} RMB="$"/>
<MoneyFormatText text="¥1200000" bigTextFontSize={20} smallTextFontSize={12} hasRMB={true}/>
<MoneyFormatText text="¥1200000" bigTextFontSize={20} smallTextFontSize={12} hasRMB={false} RMB="$"/>
<MoneyFormatText text="¥1200000" bigTextFontSize={20} smallTextFontSize={12} hasRMB={true} RMB="$" textColor="red"/>
<MoneyFormatText text="¥1200000" bigTextFontSize={20} smallTextFontSize={12} hasRMB={true} RMB="$" textColor="black"/>
<MoneyFormatText text="¥1200000" bigTextFontSize={20} smallTextFontSize={12} hasRMB={true} RMB="$"/>

Props

Prop Type Optional Default Description
text string Yes "" content of this component
textColor color Yes '#E51111' color of text
style style Yes style for this component
bigTextFontSize number Yes 25 big fontSize for one of these parts in text
smallTextFontSize number Yes 12 small fontSize for one of these parts in text
textStyle style Yes style for text when status!="money" (just normal text)
status string Yes "money" if status="money" show formatted money,else show normal text
hasRMB bool Yes true if true,will show RMB
RMB string Yes "¥" the symbol of money

To Do

https://github.com/wslcsok/React-Native-MoneyFormatText/issues

About

这是一个对金额进行格式化的React-native组件,兼容ios和android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 45.7%
  • Objective-C 32.1%
  • Python 12.6%
  • Java 9.6%