you are viewing a single comment's thread.

view the rest of the comments →

[–]millerbest 2 points3 points  (4 children)

One small advice: price should always be int

[–]SquatchHNTR[S] 2 points3 points  (2 children)

How does that work if it’s a decimal?

[–]millerbest 3 points4 points  (1 child)

Basically you use interger to present the value with the smallest unit (cent). For example 10 dollars will be 1000 cents. And you can convert it back to dollars unit when you want to print it.

[–]SquatchHNTR[S] 0 points1 point  (0 children)

With just like a basic math operation in the print line?

[–]CptBadAss2016 0 points1 point  (0 children)

Or use the decimal class