将货币显示为不同的货币类型($10 -> R10)
如何改变一种货币的价值?当我需要 R 时,我可以用我的货币换取 $。
procedure TfrmFinal.addSubtractTotal;
var
total: currency;
begin
total := 0;
frmDataModule.tblpins.First;
while not frmDataModule.tblpins.Eof do
begin
total := total +
frmDataModule.tblpins.FieldByName('qty').AsInteger *
frmDataModule.tblpins.FieldByName('price').AsCurrency;
frmDataModule.tblpins.Next;
end;
totalAmmountLabel.Text := total.ToString;
end;
how does one change the value of the type of currency? I am getting $ for my currency when i need R.
procedure TfrmFinal.addSubtractTotal;
var
total: currency;
begin
total := 0;
frmDataModule.tblpins.First;
while not frmDataModule.tblpins.Eof do
begin
total := total +
frmDataModule.tblpins.FieldByName('qty').AsInteger *
frmDataModule.tblpins.FieldByName('price').AsCurrency;
frmDataModule.tblpins.Next;
end;
totalAmmountLabel.Text := total.ToString;
end;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种解决这个问题的方法。不幸的是,我没有TCurrencyHelper,但这里还有其他一些选择:
它们都略有不同。我的偏爱是Currtostrf(然后称FloattoStrf),但这只是出于习惯。
There are a few ways to solve this. Unfortunately, I don't have the TCurrencyHelper, but here are a few other options:
All of them are slightly different. My preference would be CurrToStrF (which then calls FloatToStrF), but that is just out of habit.