Back to questions
JuniorTheoryCommon
What does the program print?
Сумма = 1234.5;
Сообщить(Формат(Сумма, "ЧДЦ=2") + " / " + Формат(Сумма, "ЧДЦ=0") + " / " + Формат(Сумма, "ЧГ=0"));1 234,50 / 1 235 / 1234,5
- Expecting
ЧДЦ=0to drop the fraction:Форматrounds, so 1234.5 becomes 1 235 - Expecting a dot before the fraction, as in the program text:
Форматputs a comma there and spaces between digit groups
- Why does
Формат(0, "ЧДЦ=2")return an empty string? - How do you print a receipt number with leading zeros through
Формат?