C
C#10mo 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
Servator10mo ago
try / 100d
ZTHEMA
ZTHEMA10mo ago
Doesn't work it did work it's my bad thank you you saved me
Servator
Servator10mo ago
np
ZTHEMA
ZTHEMA10mo ago
but what does d stand for
Servator
Servator10mo ago
double
MODiX
MODiX10mo 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
MODiX10mo 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
ZTHEMA10mo ago
i'm new in learning c#
Servator
Servator10mo ago
int / int will return int int / double will return double
MODiX
MODiX10mo 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
ZTHEMA10mo 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