From on December 9, 2014 18:12
When I run the following program, I cannot format a System.Decimal. I have an integration with a .NET library that returns a decimal type that I need to display in the ironpython script.
import System
f = 1.42742
d = System.Decimal(f)
print "{}".format(d) # 1.42742
print "{:,.2f}".format(f) # 1.43
print "{:,.2f}".format(d * 1.0) # 1.43
print "{:,.2f}".format(d) # 12f WRONG
Work Item Details
Original CodePlex Issue: Issue 34710 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Nov 30, 2013 at 1:34 PM Reported by: davcar Updated on: Dec 4, 2013 at 4:08 PM Updated by: jdhardy
Copied from original issue: IronLanguages/main#1093
该提问来源于开源项目:IronLanguages/ironpython2