Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit fbbf7d8

Browse files
committed
Change floats to use InvariantCulture
1 parent d1bfffc commit fbbf7d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ServiceStack.OrmLite.Oracle/Converters/OracleFloatConverters.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Globalization;
23
using ServiceStack.OrmLite.Converters;
34

45
namespace ServiceStack.OrmLite.Oracle.Converters
@@ -12,7 +13,7 @@ public override string ColumnDefinition
1213

1314
public override string ToQuotedString(Type fieldType, object value)
1415
{
15-
var s = value.ToString();
16+
var s = ((float)value).ToString(CultureInfo.InvariantCulture);
1617
if (s.Length > 20) s = s.Substring(0, 20);
1718
return "'" + s + "'"; // when quoted exception is more clear!
1819
}
@@ -27,7 +28,7 @@ public override string ColumnDefinition
2728

2829
public override string ToQuotedString(Type fieldType, object value)
2930
{
30-
var s = value.ToString();
31+
var s = ((double)value).ToString(CultureInfo.InvariantCulture);
3132
if (s.Length > 20) s = s.Substring(0, 20);
3233
return "'" + s + "'"; // when quoted exception is more clear!
3334
}
@@ -39,7 +40,7 @@ public OracleDecimalConverter() : base(18, 12) {}
3940

4041
public override string ToQuotedString(Type fieldType, object value)
4142
{
42-
var s = value.ToString();
43+
var s = ((decimal)value).ToString(CultureInfo.InvariantCulture);
4344
if (s.Length > 20) s = s.Substring(0, 20);
4445
return "'" + s + "'"; // when quoted exception is more clear!
4546
}

0 commit comments

Comments
 (0)