From 0e9e5016d0b4baaadda0c43b227dc205f5a5121e Mon Sep 17 00:00:00 2001 From: G9 Aerospace Date: Thu, 14 Mar 2024 13:03:23 +0530 Subject: [PATCH] ggggg --- script.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/script.js b/script.js index afaa0a4..fa475bd 100644 --- a/script.js +++ b/script.js @@ -25,7 +25,9 @@ function getCraftInfo(data) { type: '', version: '', size: '', - dimensions: '' + height: '', + width: '', + length: '' }; for (var i = 0; i < lines.length; i++) { @@ -41,9 +43,9 @@ function getCraftInfo(data) { } else if (line.startsWith('size =')) { craftInfo.size = line.split('=')[1].trim(); var dimensions = craftInfo.size.split(','); - craftInfo.dimensions = dimensions.map(function(dim) { - return parseFloat(dim).toFixed(2); - }).join(' x '); + craftInfo.height = parseFloat(dimensions[0]).toFixed(2); + craftInfo.width = parseFloat(dimensions[1]).toFixed(2); + craftInfo.length = parseFloat(dimensions[2]).toFixed(2); } } @@ -57,7 +59,8 @@ function displayCraftInfo(info) { Description: ${info.description}
Type: ${info.type}
Version: ${info.version}
- Dimensions: ${info.dimensions}
- Size: ${info.size}
+ Height: ${info.height} m
+ Width: ${info.width} m
+ Length: ${info.length} m
`; }