Cheatography
https://cheatography.com
view Dart vs C++ in advance
parse()
void main() {
print(num.parse('12'));
print(num.parse('10.91'));
}
|
The parse() static function allows parsing a string containing numeric literal into a number.
signnum.sign | Returns minus one, zero or plus one depending on the sign and numerical value of the number. |
Useful functionsNumber.abs() | Number.ceil() | Number.compareTo(x) | 0 if the values are equal. 1 if the current number object is greater than the specified numeric value.-1 if the current number object is lesser than the specified numeric value. | Number.floor() | Number.remainder(x) | Number.round() | Number.toDouble() | Number.toInt() | Number.toString() | Number.truncate() | Returns an int without decimal points. |
| | hashcodevoid main() {
int n = 5000;
print(n.hashCode);
}
syntax : num.hashcode
|
isNannum.isNan | True if the number is the double Not-a-Number value; otherwise, false. |
isevennum.iseven | Returns true if the number is an even number. |
| |
isnegativenum.isNegative | This property returns a Boolean value true if the number is a negative number. |
isoddnum.isodd | Returns true if the number is an odd number. |
|
Created By
https://www.nimakarimian.ir
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by nimakarimian