| |

VerySource

 Forgot password?
 Register
Search
View: 624|Reply: 3

Regarding the Decimal type, please give pointers

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-21 12:20:01
| Show all posts |Read mode
Decimal NewPrice = 0;
NewPrice = Decimal.Divide (10m, 30m);
come to conclusion:
NewPrice = 0.3333333333333333333333333333

Why not 0.33? How can I get 0.33
Reply

Use magic Report

0

Threads

58

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-2-1 08:27:02
| Show all posts
string.Format ("{0: F2}", NewPrice)
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-2-19 18:15:01
| Show all posts
My top
Reply

Use magic Report

0

Threads

23

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-2-20 16:00:01
| Show all posts
everever30positive solution
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list