Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 47934c41
authored
2024-11-19 10:18:01 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Modifico funcion de diferencia de frenos
1 parent
82423029
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
protected_static/cargarapida.js
protected_static/cargarapida.js
View file @
47934c4
...
...
@@ -86,11 +86,15 @@ function calcularDiferenciaPorcentaje(campo1_id, campo2_id, resultado_id) {
const
valor1
=
parseFloat
(
document
.
getElementById
(
campo1_id
).
value
.
replace
(
','
,
'.'
))
||
0
;
const
valor2
=
parseFloat
(
document
.
getElementById
(
campo2_id
).
value
.
replace
(
','
,
'.'
))
||
0
;
// Calcula la diferencia en porcentaje con respecto a valor1
const
porcentajeDiferencia
=
valor1
!==
0
?
(
Math
.
abs
(
valor1
-
valor2
)
/
valor1
*
100
).
toFixed
(
2
)
:
0
;
// Determina el mayor y el menor valor
const
mayor
=
Math
.
max
(
valor1
,
valor2
);
const
menor
=
Math
.
min
(
valor1
,
valor2
);
// Calcula la diferencia porcentual con respecto al mayor valor
const
porcentajeDiferencia
=
mayor
!==
0
?
((
mayor
-
menor
)
/
mayor
*
100
).
toFixed
(
2
)
:
0
;
// Coloca el resultado en el campo de resultado
document
.
getElementById
(
resultado_id
).
value
=
porcentajeDiferencia
;
document
.
getElementById
(
resultado_id
).
value
=
porcentajeDiferencia
;
}
function
isStatusActive
(
status
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment