imxc 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lowering.js +9 -2
- package/package.json +1 -1
package/dist/lowering.js
CHANGED
|
@@ -727,8 +727,15 @@ function lowerTextElement(node, body, ctx, loc) {
|
|
|
727
727
|
args.push(cppExpr);
|
|
728
728
|
break;
|
|
729
729
|
case 'float':
|
|
730
|
-
|
|
731
|
-
|
|
730
|
+
if (cppExpr.startsWith('props.')) {
|
|
731
|
+
// Props fields: number could be int or float in C++, cast to double for safe printf
|
|
732
|
+
format += '%g';
|
|
733
|
+
args.push(`(double)${cppExpr}`);
|
|
734
|
+
}
|
|
735
|
+
else {
|
|
736
|
+
format += '%.2f';
|
|
737
|
+
args.push(cppExpr);
|
|
738
|
+
}
|
|
732
739
|
break;
|
|
733
740
|
case 'bool':
|
|
734
741
|
format += '%s';
|