Skip to content

Commit

Permalink
Fix: Select not displaying chargeDensity
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRasho committed Nov 7, 2023
1 parent 6e0875c commit 40f2ee2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ const engine = ref(new SimulationEngine(context.value))
const clearSignal = ref(false)
const materialsList = Object.values(WIRE_MATERIALS).map(
(material) => `${material.name} (${material.chargeDensity.unit})`
(material) => {
const materialDensity = parseFloat(material.chargeDensity.value).toExponential(3)
return `${material.name} (${materialDensity} ${material.chargeDensity.unit})`
}
)
function startSimulation() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/WireMaterials.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const AVOGADRO = 6.02214076e23
* @returns {Number} La densidad de carga en electrones/m^3.
*/
const computeChargeDensity = (electrons, molarMass, density) =>
((electrons * AVOGADRO) / molarMass) * density * 100_00_00
(((electrons * AVOGADRO) / molarMass) * density * 100_00_00)

/**
* Enum of posible wire materials along with its
Expand Down

0 comments on commit 40f2ee2

Please sign in to comment.