INNER CODE UNIT · JavaScript

doubleFromPercentString

lucasferreira/react-native-flash-message · src/FlashMessageWrapper.js:73

const doubleFromPercentString = percent => {
  if (!percent || !percent.includes("%")) {
    return 0;
  }

  const dbl = parseFloat(percent) / 100;

  if (isNaN(dbl)) return 0;

  return dbl;
};

/**
 * Helper function to "append" extra padding in MessageComponent style
 */
export function styleWithInset(style, wrapperInset, hideStatusBar = false, prop = "padding") {
  if (prop === "margin") {
    return styleWithInsetMargin(style, wrapperInset, hideStatusBar);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…