Bug 53415 - Decimal.ToString() and values close to zero
Summary: Decimal.ToString() and values close to zero
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 4.20.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-03-16 20:59 UTC by Eric Lacau
Modified: 2017-06-28 01:08 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
TestCase (15.78 KB, application/x-zip-compressed)
2017-06-28 01:08 UTC, Cody Beyer (MSFT)
Details

Description Eric Lacau 2017-03-16 20:59:28 UTC
When using decimal.ToString("0.00;-0.00", CultureInfo.GetCultureInfo("FR-fr")), results differ between android platform and PC platform when values are close to 0.


CultureInfo = CultureInfo.GetCultureInfo("FR-fr");
decimal value = -0.004;
string resultString = value.ToString("0.00;-0.00", culture);


Actual result : 
    -0.00
Expected result :
     0.00
Comment 1 Cody Beyer (MSFT) 2017-06-28 01:07:38 UTC
Attached is a test case.

Steps to Reproduce Issue:

1. Download test case
2. Deploy to Android
3. Click Button

# Versions

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.14) Release
VisualStudio.15.Release/15.2.0+26430.14
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Visual Basic 2017   00369-60000-00001-AA890
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA890
Microsoft Visual C# 2017

Visual C++ 2017   00369-60000-00001-AA890
Microsoft Visual C++ 2017

Visual F# 4.1   00369-60000-00001-AA890
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.6.00404.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

Common Azure Tools   1.9
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

TypeScript   2.2.2.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   15.0.26430.06
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.5.0.486 (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.3.1.2 (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.10.0.37 (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 2 Cody Beyer (MSFT) 2017-06-28 01:08:06 UTC
Created attachment 23158 [details]
TestCase

Note You need to log in before you can comment on or make changes to this bug.