C
C#12mo ago
ZTHEMA

c# calculate a discount

Hi guys i'm trying to makeup calcultor for discount but my does not work if anyone Can help plzaz
11 Replies
Servator
Servator12mo ago
try / 100d
ZTHEMA
ZTHEMAOP12mo ago
Doesn't work it did work it's my bad thank you you saved me
Servator
Servator12mo ago
np
ZTHEMA
ZTHEMAOP12mo ago
but what does d stand for
Servator
Servator12mo ago
double
MODiX
MODiX12mo ago
Servator
REPL Result: Success
3/4
3/4
Result: int
0
0
Compile: 141.400ms | Execution: 15.492ms | React with ❌ to remove this embed.
MODiX
MODiX12mo ago
Servator
REPL Result: Success
3/4d
3/4d
Result: double
0.75
0.75
Compile: 278.481ms | Execution: 16.628ms | React with ❌ to remove this embed.
ZTHEMA
ZTHEMAOP12mo ago
i'm new in learning c#
Servator
Servator12mo ago
int / int will return int int / double will return double
MODiX
MODiX12mo ago
Servator
REPL Result: Success
(5/2, 5/2d)
(5/2, 5/2d)
Result: ValueTuple<int, double>
{
"item1": 2,
"item2": 2.5
}
{
"item1": 2,
"item2": 2.5
}
Compile: 273.975ms | Execution: 34.045ms | React with ❌ to remove this embed.
ZTHEMA
ZTHEMAOP12mo ago
ok this complicatted i did actually first write double but i did not word and did not inderstand why i writed like this : pap =((double)pp)*((double)tr/(double)100)
Want results from more Discord servers?
Add your server