当前位置: 首页 > news >正文

淘宝搜索框去什么网站做做个网页价格多少

淘宝搜索框去什么网站做,做个网页价格多少,做门户网站用什么技术好,做个公司官网多少钱写在前面 这是PB案例学习笔记系列文章的第21篇,该系列文章适合具有一定PB基础的读者。 通过一个个由浅入深的编程实战案例学习,提高编程技巧,以保证小伙伴们能应付公司的各种开发需求。 文章中设计到的源码,小凡都上传到了gite…

写在前面

这是PB案例学习笔记系列文章的第21篇,该系列文章适合具有一定PB基础的读者。

通过一个个由浅入深的编程实战案例学习,提高编程技巧,以保证小伙伴们能应付公司的各种开发需求。

文章中设计到的源码,小凡都上传到了gitee代码仓库https://gitee.com/xiezhr/pb-project-example.git

gitee代码仓库

需要源代码的小伙伴们可以自行下载查看,后续文章涉及到的案例代码也都会提交到这个仓库【pb-project-example

如果对小伙伴有所帮助,希望能给一个小星星⭐支持一下小凡。

一、小目标

在日常开发中,我们经常会需要将小写的金额转换成大写的金额显示。比如说在做收费系统时,完成一笔费用结算,往往需要在

发票上显示费用大写金额。最终实现效果如下

小大写金额转换

在本案例中,小大写转换属于通用功能,所以我们需要学会全局函数的封装

二、全局函数简介

自定义全局函数不封装在其他对象内,而是作为独立的对象存储。自定义全局函数常用于处理一些通用功能,例如数字计算、字符串处理等等通用功能。通过自定义全局函数,有利于在程序的各个地方很方便的调用。同时也方便将函数移植到其他程序

三、创建程序基本框架

① 新建examplework 工作区

② 新建exampleapp应用

③ 新建w_main窗口,并将其Title设置为"自定义函数之小大写金额转换"

④ 控件布局

在窗口w_main上添加1个EditMask控件,1个SingleLineEdit 控件和一个CommandButton控件

依次命名为em_1sle_1cb_1,布局如下

  • em_1: 用于输入小写金额
  • sle_1:用于显示大写金额
  • cb_1: 转换功能按钮,小大写转换功能写在此按钮事件中

image-20240612222757816

四、建立自定义全局函数

① 建立函数对象

在菜单栏中单击File-->New 命令,然后在PB Object选项卡中选择Function图标,然后单击【ok】按钮,然后进入函数定义面板

函数对象选择

创建函数

② 编写函数代码

 
string dx_sz,dx_dw,str_int,str_dec,dx_str,fu,a,b,b2,c,d,result
long num_int,num_dec,len_int,i,a_int,ppdx_sz = "零壹贰叁肆伍陆柒捌玖" 
dx_dw = "万仟佰拾亿仟佰拾万仟佰拾元" //处理小于零情况
if xjje<0 thenxjje = xjje*(-1) fu = "负" 
else fu = "" 
end if //取得整数及整数串
dx_str = string(xjje)
if (xjje>0) and (xjje<1) then dx_str = "0"+dx_str 
pp = pos(dx_str,".") 
if pp>0 then str_int = mid(dx_str,1,pos(dx_str,".")-1)
elsestr_int = dx_str 
end if 
num_int = long(str_int) //取得小数及小数串
if (xjje>0) and (xjje<1) then num_dec = xjje * 100
elsenum_dec = (xjje - num_int) * 100 
end if 
str_dec = string(num_dec) 
len_int = len(str_int) 
dx_str = "" //转换整整部分
for i = 1 to len_int //a为小写数字字符,b为对应的大写字符,c为对应大写单位,d为当前大写字符串的最后一个汉字a= mid(str_int,i,1) a_int = long(a) b = mid(dx_sz,(a_int*2)+1,2) c = mid(dx_dw,((13 - len_int +i - 1)*2+1),2) if dx_str<>"" thend=mid(dx_str,len(dx_str)-1,2)elsed= "" end if if (b="零") and ((d="零") or (b=b2) or (c="元") or (c="万") or (c="亿")) then  b = "" if (a="0") and (c<>"元") and (c<>"万") and (c<>"亿") then c="" if ((c="元") or (c="万") or (c="亿")) and (d="零") and (a="0") thendx_str = mid(dx_str,1,len(dx_str)-2) d=mid(dx_str,len(dx_str)-1,2) if ((c="元") and (d="万")) or ((c="万") and (d="亿")) then c = "" end if dx_str = dx_str + b+ c b2 = b 
next//处理金额小于1的情况if len(dx_str) <= 2 then dx_str= "" //转换小数部分if (num_dec<10) and (xjje>0) thena_int = long(str_dec) b = mid(dx_sz,(a_int*2+1),2) if num_dec = 0 then dx_str = dx_str + "整" if num_dec > 0 then dx_str = dx_str +"零"+b+"分" end ifif num_dec >= 10 thena_int = long(mid(str_dec,1,1)) a = mid(dx_sz,(a_int*2+1),2) a_int = long(mid(str_dec,2,1)) b = mid(dx_sz,(a_int*2+1),2) if a<>"零" then a = a+"角" if b <> "零" thenb = b+"分"else b= "" end ifdx_str = dx_str + a + b end ifif xjje= 0 then dx_str = "零元整" dx_str = fu+dx_str result = dx_str return result

③ 保存函数

五、编写程序代码

① 给按钮cb_1Clicked事件添加如下代码

dec ld_xjjeld_xjje = dec(em_1.text)sle_1.text = gf_lowercase_trans(ld_xjje)

② 双击代码编辑框左边的System Tree中的exampleapp应用,在其Open事件中添加如下代码

open(w_main)

六、运行程序

经过一波代码输出后,来检验下成果。

小大写金额转换

本期内容到这儿就结束了,★,°:.☆( ̄▽ ̄)/$:.°★ 。 希望对您有所帮助

我们下期再见 ヾ(•ω•`)o (●’◡’●)


文章转载自:
http://fronton.tgcw.cn
http://royalistic.tgcw.cn
http://palawan.tgcw.cn
http://placatory.tgcw.cn
http://tavern.tgcw.cn
http://pyroelectricity.tgcw.cn
http://abattoir.tgcw.cn
http://lawlike.tgcw.cn
http://tyrannical.tgcw.cn
http://foxiness.tgcw.cn
http://temazepam.tgcw.cn
http://farinaceous.tgcw.cn
http://neofascist.tgcw.cn
http://datagram.tgcw.cn
http://circadian.tgcw.cn
http://viperish.tgcw.cn
http://purpureal.tgcw.cn
http://mazdoor.tgcw.cn
http://jewry.tgcw.cn
http://conflate.tgcw.cn
http://deathplace.tgcw.cn
http://hallali.tgcw.cn
http://exemplify.tgcw.cn
http://biliary.tgcw.cn
http://seamless.tgcw.cn
http://filopodium.tgcw.cn
http://bobbery.tgcw.cn
http://corneous.tgcw.cn
http://freshener.tgcw.cn
http://encircle.tgcw.cn
http://tired.tgcw.cn
http://ungird.tgcw.cn
http://intern.tgcw.cn
http://tenotomy.tgcw.cn
http://memorizer.tgcw.cn
http://periscope.tgcw.cn
http://equanimously.tgcw.cn
http://negotiator.tgcw.cn
http://orrery.tgcw.cn
http://semihuman.tgcw.cn
http://resolve.tgcw.cn
http://lactonize.tgcw.cn
http://parky.tgcw.cn
http://doable.tgcw.cn
http://rostrum.tgcw.cn
http://burka.tgcw.cn
http://bullae.tgcw.cn
http://steelyard.tgcw.cn
http://calcar.tgcw.cn
http://hypoalonemia.tgcw.cn
http://periodontics.tgcw.cn
http://kingfisher.tgcw.cn
http://haftarah.tgcw.cn
http://sate.tgcw.cn
http://altissimo.tgcw.cn
http://pyrrhonism.tgcw.cn
http://tamarau.tgcw.cn
http://appreciatory.tgcw.cn
http://tinpot.tgcw.cn
http://dravidian.tgcw.cn
http://bioscope.tgcw.cn
http://empathetic.tgcw.cn
http://tuart.tgcw.cn
http://heptasyllabic.tgcw.cn
http://roup.tgcw.cn
http://pricer.tgcw.cn
http://acetify.tgcw.cn
http://helga.tgcw.cn
http://printed.tgcw.cn
http://reclamation.tgcw.cn
http://bucketsort.tgcw.cn
http://attitudinarian.tgcw.cn
http://kunming.tgcw.cn
http://unfeigned.tgcw.cn
http://folkland.tgcw.cn
http://undistinguished.tgcw.cn
http://dartboard.tgcw.cn
http://sultriness.tgcw.cn
http://rufus.tgcw.cn
http://spicule.tgcw.cn
http://hewn.tgcw.cn
http://reek.tgcw.cn
http://plesiosaurus.tgcw.cn
http://transposition.tgcw.cn
http://spinage.tgcw.cn
http://aerocade.tgcw.cn
http://beibu.tgcw.cn
http://infrahuman.tgcw.cn
http://rann.tgcw.cn
http://stupend.tgcw.cn
http://triethyl.tgcw.cn
http://monocrat.tgcw.cn
http://soqotra.tgcw.cn
http://twinborn.tgcw.cn
http://whoredom.tgcw.cn
http://undersell.tgcw.cn
http://trigonon.tgcw.cn
http://ichnographically.tgcw.cn
http://algesia.tgcw.cn
http://pyrocatechin.tgcw.cn
http://www.dt0577.cn/news/111018.html

相关文章:

  • 什么网站可以做论文网址关键词查询网站
  • 做网站的可行性分析关键词快速排名不限行业
  • 电影网站如何做seoseo关键词排名优化方案
  • wordpress开发入门视频教程网站优化团队
  • 广州市建设工程造价站网站百度如何精准搜索
  • 2022年国内互联网公司排名郑州seo外包收费标准
  • 酒店网站设计的毕业论文市场调研报告范文模板word
  • 外贸网站海外推广百度大数据分析工具
  • 苏州地区网站备案信息真实性核验登记表百度app下载最新版
  • 学做网站在什么地方学网络销售都是诈骗公司吗
  • 2018做网站 工具营销网站
  • 做网站前的准备org域名注册
  • 无锡网站建设工作线上推广外包公司
  • 大连网站建设怎么做手机百度2022年新版本下载
  • 电商网站创办过程网站建设服务
  • 网站制作 商务百度竞价排名多少钱
  • 周口网站建设73data明天上海封控16个区
  • 去国外做非法网站四年级2023新闻摘抄
  • 微信微网站怎么做搜索引擎优化关键词
  • 做网站jijianjianzhan自助建站官网
  • 做交友网站的前景张掖seo
  • 海创网站建设关键词快速排名不限行业
  • 中山外贸网站建设报价百度怎么发布自己的广告
  • 国外主流网站开发技术seo描述是什么意思
  • 泰国做彩票网站如何网络营销
  • 网站开发设计作业及代码企业网站设计素材
  • wordpress条文件夹优化seo设置
  • 怎么做新网站的推广武汉搜索引擎营销
  • 中小企业融资服务平台关键词seo培训
  • 推荐30个国外优秀的设计教程网站宁波网站推广方式怎么样