不起作用的功能总和. [英] dont work function sum.

查看:60
本文介绍了不起作用的功能总和.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友

我有一个叫价格的字段
我想用cr v11向您显示总价.
表中价格为100,000,233,000
不要使用功函数总和.
共享数Var sum1; WhilePrintingRecords; sum1:= ToNumber({table1.price)+ sum1;
错误:字符串为非数字
如何将'',''分割为100,000,233,000,或用,"补充",
请帮助我;

Hi friends

I have a field called price
I want with cr v11 to show you the total price.
Prices shown in the table is 100,000,233,000
dont work function sum.
Shared numberVar sum1 ;WhilePrintingRecords; sum1:= ToNumber({table1.price)+sum1;
error: The string is non-numeric
how split '','' for 100,000,233,000 or replece "" with ","
please help me;

推荐答案

也许,如果您关闭括号,它可能会更好?
Perhaps, if you closed the braces, it might work better?
Shared numberVar sum1 ;WhilePrintingRecords; sum1:= ToNumber({table1.price)+sum1;

成为

Shared numberVar sum1 ;WhilePrintingRecords; sum1:= ToNumber({table1.price})+sum1;

如果这不起作用,则可能是您的数据有误,或者您可能需要使用Val函数.

If that doesn''t work, either your data is at fault, or you may need to use the Val function instead.


如果您解析字符串中的逗号,请记住逗号可以是基于系统上的本地化设置的任何字符,因此请确保您根据语言环境解析数字分隔符,然后添加数字.
If you parse the string for commas, remember the comma could be any character based on the localization set on your system, so make sure you parse the numeric separator based on the locale and then add the number.


我意识到我的解决方案


stringVar array splitstr:= Split(({{table.price}),,");

本地号码Var i;
本地号码Var arrLen:= UBound(splitstr);

对于i:= 1到arrlen做
(
本地stringVar str:=";
str:= str + splitstr [i];
);

sum(str);
I realized my solution


stringVar array splitstr := Split(({table.price}),",");

Local NumberVar i ;
Local NumberVar arrLen := UBound(splitstr);

For i:= 1 to arrlen do
(
local stringVar str :="";
str := str + splitstr[i];
);

sum(str);


这篇关于不起作用的功能总和.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆