Coder Social home page Coder Social logo

Comments (9)

xiahengchen avatar xiahengchen commented on June 12, 2024

Hi @Dudo1985, thank you for reporting! We have fixed the issue that you reported and so you can checkout feature/pricing-amount-fraction-fix branch to check the changes.

from pricing-page.

iksent avatar iksent commented on June 12, 2024

Hello, @xiahengchen!
I have just checked pricing-amount-fraction-fix and it's not working as expected: there are no dots for now, but the prices aren't correct, take a look:

Prev version:
2020-10-14_10-04-30
2020-10-14_10-04-38
2020-10-14_10-04-44

And the new version:
2020-10-14_10-04-54

PS: And may be we should use dot instead of comma at "Normally ..." text?

2020-10-14_10-02-54

from pricing-page.

iksent avatar iksent commented on June 12, 2024

By the way, don't you think, that we should display price per year, not per month, so users can see the final price instantly without calculations in their heads ;)

Or at least display per month and per year.

from pricing-page.

vovafeldman avatar vovafeldman commented on June 12, 2024

@iksent the code is intentionally using num.toLocaleString() to show the prices based on the local numeric format. Some countries use "." for decimal digits separation, but some use ",". That's btw also the reason we failed to fix the bug on the first try. @xiahengchen is already working on the fix.

With regard to your question, it's psychologically easier to commit when seeing smaller numbers rather than showing the annual price, so this practice is known to increase conversion rate. At a later stage, we may introduce a flag for you to choose if you prefer to show the annual prices.

from pricing-page.

iksent avatar iksent commented on June 12, 2024

+1 for flag and more configurations :)

from pricing-page.

xiahengchen avatar xiahengchen commented on June 12, 2024

@iksent Please pull the latest changes of feature/pricing-amount-fraction-fix branch and you can see the bug has been fixed. Please let me know if this works for you.

from pricing-page.

iksent avatar iksent commented on June 12, 2024

Hello, @xiahengchen!

There is the result of the latest fixes:

2020-10-22_14-00-20

I have a special JS-function to display the prices correctly. You can try to use it too:

export const toFixedN = (
  number: ?number,
  fractionDigits: number = 4,
  canBeNull: boolean = true,
): string => {
  let num = number

  num = +num
  if (isNaN(num)) {
    return '-'
  }
  if (num === 0) {
    return canBeNull ? '0' : '~0'
  }
  if (num < 1) {
    num = num.toFixed(fractionDigits).replace(/\.?0+$/, '')
  } else {
    num = parseFloat(num.toFixed(fractionDigits))
  }
  return +num === 0 ? `~${num}` : num.toString()
}

This function works like standard toFixed but also handles small values (<1) correctly.

from pricing-page.

xiahengchen avatar xiahengchen commented on June 12, 2024

Sorry for the inconvenience @iksent. We fixed the above issue and pushed the changes to the feature/pricing-amount-fraction-fix branch. Please check it and let us know if you still see any issues.

from pricing-page.

vovafeldman avatar vovafeldman commented on June 12, 2024

Merged to the develop branch PR #9

from pricing-page.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.