Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
¿Cómo formatear la mitad del tamaño con la etiqueta <sup>?

A continuación se muestra una función para unir palabras. Dado que la primera o la última palabra podría ser una cadena como 7 1/2, ¿cómo me aseguraría de eso? si la palabra contiene una fracción, formatee la fracción con etiquetas (superíndice)... ¿para que se muestre bien como a continuación?

 export const joinWords = (words: string[]): string => { if (words.length === 1) { return words[0]; } const firstWords = words.slice(0, words.length - 1); const lastWord = words[words.length - 1]; const oxfordComma = words.length > 2; //if firstWords or lastword contains "/"...Logic??? return firstWords.join(', ') + `${oxfordComma ? ', ' : ''} and ${lastWord}`; };

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Encontré una forma alternativa, donde uso el método de reemplazo. Estoy usando svelte por lo tanto el onmount ..

 onMount(() => { //join the words const test = joinWords(optionNames); //replace the "1/2" since I am only using 1/2 for clothing sizes...this may not work for other fractions.. const newTest = test.replace('1/2', '&frac12;'); testWord = newTest; });
 //be sure to return as html...again im in svelte. <span>{@html testWord} </span><br />
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!