The most correct way to get a simple string? #405
              
                
                  
                  
                    Answered
                  
                  by
                    scurker
                  
              
          
                  
                    
                      vresetnikov
                    
                  
                
                  asked this question in
                Q&A
              
            -
| Hello, silly question perhaps, but what would be the most correct way to get the value of type string from the currency object? Just a raw string. For example: 3.32 => "3.32" . Without a symbol or anything else? Thank you | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            scurker
          
      
      
        Jul 22, 2022 
      
    
    Replies: 1 comment
-
| Depending on how you're using it, you may not have to do anything: const value = currency(1234.56)
// The value below will automatically be coerced to the string value of "1234.56"
document.getElementById('amount').value = valueOtherwise, you can call  | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
      Answer selected by
        scurker
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Depending on how you're using it, you may not have to do anything:
Otherwise, you can call
.toString()directly, or.format()if you want to have a formatted string value with a currency symbol and group separators.