v2.3.2
numerus
पूर्णांकों को रोमन अंकों में और रोमन अंकों के स्ट्रिंग को पूर्णांक में बदलने के लिए Dart एक्सटेंशन।
18लाइक 74.1 हज़ार30-दिन डाउनलोड160Pub अंक
AndroidiOSWebmacOSWindowsLinux
डार्ट एक्सटेंशन: दशमलव संख्या को रोमन अंकों में और उलटे क्रम में बदलने के लिए
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
Dart extensions for translating decimal numbers to Roman numerals and vice versa.
import 'package:numerus/numerus.dart';
void main() {
/// 1) Nice and easy, default config is the "common" config.
var n = 418;
print(n.toRomanNumeralString());
// 'CDXVIII'
var str = 'CDXVIII';
print(str.isValidRomanNumeralValue());
// true
print(str.toRomanNumeralValue());
// 418
/// 2) You can specify other [RomanNumeralConfig]'s to change the style.
/// You can set the config globally, if you'd like.
RomanNumerals.romanNumeralsConfig = VinculumRomanNumeralsConfig();
/// 3) Vinculum config style
n = 3449671;
print(n.toRomanNumeralString());
// M̅M̅M̅C̅D̅X̅L̅MX̅DCLXXI
str = 'M̅M̅M̅C̅D̅X̅L̅MX̅DCLXXI';
print(str.isValidRomanNumeralValue());
// true
print(str.toRomanNumeralValue());
// 3449671
/// 4) You can specify the config inline, too.
/// 5) Apostrophus style
n = 2449671;
print(n.toRomanNumeralString(config: ApostrophusRomanNumeralsConfig()));
// CCCCIↃↃↃↃCCCCIↃↃↃↃCCCIↃↃↃIↃↃↃↃCCIↃↃIↃↃↃCIↃCCIↃↃIↃCLXXI
/// 6) ... but frankly, globally set is probably the most common use case
RomanNumerals.romanNumeralsConfig = ApostrophusRomanNumeralsConfig();
str = 'CCCCIↃↃↃↃCCCCIↃↃↃↃCCCIↃↃↃIↃↃↃↃCCIↃↃIↃↃↃCIↃCCIↃↃIↃCLXXI';
print(str.isValidRomanNumeralValue());
// true
print(str.toRomanNumeralValue());
// 2449671
/// 7) The compact Apostrophus style uses special Unicode characters
/// just for these symbols.
RomanNumerals.romanNumeralsConfig = CompactApostrophusRomanNumeralsConfig();
n = 347449;
print(n.toRomanNumeralString());
// ↈↈↈↂↇↁↀↀCCCCXLIX
// NOTE: if you see missing characters in this example, then you'll need to
// install a font that supports them.
str = 'ↈↈↈↂↇↁↀↀCCCCXLIX';
print(str.isValidRomanNumeralValue());
// true
print(str.toRomanNumeralValue());
// 347449
/// 8) You can specify a "nulla" (zero placeholder) if you want
/// to support zero easily.
RomanNumerals.romanNumeralsConfig = CommonRomanNumeralsConfig(nulla: 'N');
n = 0;
print(n.toRomanNumeralString());
// N
str = 'N';
print(str.isValidRomanNumeralValue());
// true
print(str.toRomanNumeralValue());
// 0
}
Please file feature requests and bugs at the issue tracker.
coverage tool$ dart pub global activate coverage
lcov on your system.
e.g. macOS with brew:$ brew install lcov
$ ./bin/coverage-gen
# If you are on macOS and would like the report to immediately
# open, then run the following (not suitable for automation):
$ ./bin/coverage-gen -i
निर्भरता सूची 3 आइटम
^1.3.0^5.0.0^1.21.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗