Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/kotlin/mate/academy/BuyProducts.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package mate.academy

fun getTotalPriceMessage(client: String, price: Int, quantity: Int): String {
return ""
return "$client has to pay $${quantity * price} per $quantity products"

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string literal won’t compile in Kotlin: $$ isn’t a valid way to emit a dollar sign inside a string template (the $ must be escaped). Use an escaped dollar sign before the total (e.g., \$${quantity * price}) so the output matches the expected "$" format.

Suggested change
return "$client has to pay $${quantity * price} per $quantity products"
return "$client has to pay \$${quantity * price} per $quantity products"

Copilot uses AI. Check for mistakes.
}
Loading