0E-8是什么鬼?

本文介绍如何处理 MySQL 查询结果中出现的 0e-8 值,提供 BigDecimal 转换方法及判断逻辑,确保数据显示为正常的 0。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MYSQL多表联查,右表中无对应数据(decimal),用 IFNULL() 设置默认值为0,后台查询结果为 0e-8。

做的pdf导出功能,pdf中显示某个字段为0e-8肯定是不行的,其实0e-8就是0,需要代码转换为0即可:

(new BigDecimal("0E-8")).doubleValue()

也可以做一下判断,如果为0e-8就直接显示为0:

daddy.getMoney().compareTo(new bigDecimal(0E-8))==0?new bigDecimal(0):daddy.getMoney();



本版中只有一个用于生产环境的文件:BigDecimal-all-last.min.js,大小为26K,如果WEB服务器打开GZIP压缩,可以减小至7K,如需完整版本请移步至:http://download.youkuaiyun.com/detail/aquaqu2009/4575230 简单用法: var scale = 20; var e = new BigDecimal("0"); var denominator = new BigDecimal("1"); var eBefore = new BigDecimal("-1"); var iteration = 1; while (!e.equals(eBefore)) { eBefore = e; e = e.add(BigDecimal.prototype.ONE.divide(denominator, scale, BigDecimal.prototype.ROUND_HALF_UP)); denominator = denominator.multiply(new BigDecimal(iteration+'')); ++iteration; } equal(e.toString(), "2.71828182845904523536"); ok(new BigDecimal("1234.5678").isPositive(), "1234.5678 is positive"); ok(new BigDecimal("-1234.5678").isNegative(), "-1234.5678 is negative"); ok(!BigDecimal.prototype.ZERO.isPositive() && !BigDecimal.prototype.ZERO.isNegative(), "BigDecimal.prototype.ZERO is neither positive nor negative"); ok(BigDecimal.prototype.ZERO.isZero(), "BigDecimal.prototype.ZERO is zero"); ok(new BigDecimal("1234.0000").isLessThan(new BigDecimal("1234.5678")) && new BigDecimal("1234.0000").isLessThanOrEqualTo(new BigDecimal("1234.5678")), "1234.0000 is less than 1234.5678"); ok(!new BigDecimal("1234.0000").isGreaterThan(new BigDecimal("1234.5678")) && !new BigDecimal("1234.0000").isGreaterThanOrEqualTo(new BigDecimal("1234.5678")), "1234.0000 is not greater than 1234.5678"); ok(new BigDecimal("1234.5678").isGreaterThan(new BigDecimal("1234.0000")) && new BigDecimal("1234.5678").isGreaterThanOrEqualTo(new BigDecimal("1234.0000")), "1234.5678 is greater than 1234.0000"); ok(!new BigDecimal("1234.5678").isLessThan(new BigDecimal("1234.0000")) && !new BigDecimal("1234.5678").isLessThanOrEqualTo(new BigDecimal("1234.0000")), "1234.5678 is not less than 1234.0000"); ok(new BigDecimal("1234.5678").isLessThanOrEqualTo(new BigDecimal("1234.5678")) && new BigDecimal("1234.5678").isGreaterThanOrEqualTo(new BigDecimal("1234.5678")), "1234.5678 is less than or equal to itself as well as greater than or equal to itself"); 别整个复制粘贴啊,那样是运行不起来的,请粘贴您需要的代码,,
# Ultralytics YOLO 🚀, AGPL-3.0 license # RT-DETR-l object detection model with P3-P5 outputs. For details see https://docs.ultralytics.com/models/rtdetr # Parameters nc: 80 # number of classes scales: # model compound scaling constants, i.e. 'model=yolov8n-cls.yaml' will call yolov8-cls.yaml with scale 'n' # [depth, width, max_channels] l: [1.00, 1.00, 1024] # From BiliBili 魔面具 backbone: # [from, repeats, module, args] - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2 - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4 - [-1, 1, C2f_PFDConv, [128]] - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8 - [-1, 1, C2f_PFDConv, [256]] - [-1, 1, Conv, [384, 3, 2]] # 5-P4/16 - [-1, 1, C2f_PFDConv, [384]] - [-1, 1, Conv, [384, 3, 2]] # 7-P5/32 - [-1, 3, C2f_PFDConv, [384]] head: - [-1, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 9 input_proj.2 - [-1, 1, AIFI, [1024, 8]] # 10 - [-1, 1, Conv, [256, 1, 1]] # 11, Y5, lateral_convs.0 - [-1, 1, nn.Upsample, [None, 2, 'nearest']] # 12 - [6, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 13 input_proj.1 - [[-2, -1], 1, Concat, [1]] # 14 - [-1, 1, CSP_PAC, [256]] # 15, fpn_blocks.0 - [-1, 1, Conv, [256, 1, 1]] # 16, Y4, lateral_convs.1 - [-1, 1, AttentionUpsample, []] # 17 - [4, 1, Conv, [256, 1, 1, None, 1, 1, False]] # 18 input_proj.0 - [[-2, -1], 1, Concat, [1]] # 19 cat backbone P4 - [-1, 1, CSP_PAC, [256]] # X3 (20), fpn_blocks.1 - [-1, 1, AttentionDownsample, []] # 21, downsample_convs.0 - [[-1, 16], 1, Concat, [1]] # 22 cat Y4 - [-1, 3, CSP_PAC, [256]] # F4 (23), pan_blocks.0 - [-1, 1, AttentionDownsample, []] # 24, downsample_convs.1 - [[-1, 11], 1, Concat, [1]] # 25 cat Y5 - [-1, 3,CSP_PAC, [256]] # F5 (26), pan_blocks.1 - [[20, 23, 26], 1, RTDETRDecoder, [nc, 256, 300, 4, 8, 3]] # Detect(P3, P4, P5)检查错误
最新发布
08-07
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值