This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1007,6 +1007,11 @@ public static float ToFloat(this string text)
1007
1007
return text == null ? default ( float ) : float . Parse ( text ) ;
1008
1008
}
1009
1009
1010
+ public static float ToFloatInvariant ( this string text )
1011
+ {
1012
+ return text == null ? default ( float ) : float . Parse ( text , CultureInfo . InvariantCulture ) ;
1013
+ }
1014
+
1010
1015
public static float ToFloat ( this string text , float defaultValue )
1011
1016
{
1012
1017
float ret ;
@@ -1018,6 +1023,11 @@ public static double ToDouble(this string text)
1018
1023
return text == null ? default ( double ) : double . Parse ( text ) ;
1019
1024
}
1020
1025
1026
+ public static double ToDoubleInvariant ( this string text )
1027
+ {
1028
+ return text == null ? default ( double ) : double . Parse ( text , CultureInfo . InvariantCulture ) ;
1029
+ }
1030
+
1021
1031
public static double ToDouble ( this string text , double defaultValue )
1022
1032
{
1023
1033
double ret ;
@@ -1029,6 +1039,11 @@ public static decimal ToDecimal(this string text)
1029
1039
return text == null ? default ( decimal ) : decimal . Parse ( text ) ;
1030
1040
}
1031
1041
1042
+ public static decimal ToDecimalInvariant ( this string text )
1043
+ {
1044
+ return text == null ? default ( decimal ) : decimal . Parse ( text , CultureInfo . InvariantCulture ) ;
1045
+ }
1046
+
1032
1047
public static decimal ToDecimal ( this string text , decimal defaultValue )
1033
1048
{
1034
1049
decimal ret ;
You can’t perform that action at this time.
0 commit comments