FAQ Database Discussion Community


How to make my cheque generator output exactly what it is instead of “Zero” in C

c,compilation,generator,zero,money
My Cheque generator program has worked flawlessly for any input you give it to make it output the numerals in words. for example if I were to input "1234.56" it will out put "One Thousand Two Hundred Thirty Four Dollars and ... 56 Cents". However whenever I want to output...

Is Money gem usable with Mongoid?

mongodb,mongoid,money,bigint,money-rails
It fits in the "schema" or document model files just fine as a type: Money However, any time I need the Money I get a string of a float in return. I understand it's dealing with MongoDB internally but I find my app littered with conversions of strings like BigInt.new("1.23")...

ANDROID- Send money to user? Paypal

android,paypal,money
In my Android app, I need it to where, if the user has enough points, then they can click a button that will then send them money through PayPal. It's basically like those apps where you watch ads for points, then you redeem for PayPal cash. The problem is, I...

Why does my program give me the excess output? C program

c,if-statement,generator,money
I've made a program that is a cheque generator. Whatever amount you input in the scanf will output in words. For example if I were to to input "1234.56" My output will be "One Thousand Two Hundred Thirty Four Dollars and ... 56 Cents", or if I wanted to input...

Where should I put the json result in money.js?

javascript,json,money
Reading the documentation http://openexchangerates.github.io/money.js/#fx.rates Its says you need to set up your rates: fx.base = "USD"; fx.rates = { "EUR" : 0.745101, // eg. 1 USD === 0.745101 EUR "GBP" : 0.647710, // etc... "HKD" : 7.781919, "USD" : 1, // always include the base rate (1:1) /* etc */...

Sanitize dollar value before saving

ruby-on-rails,ruby,ruby-on-rails-4,money
I have an input field on a form that has the users enter in a dollar amount. I'm using autoNumeric to mask that field so that as a user inputs 1000, it displays 1,000.00 in the text field. The column in the database (requested_amount) is a decimal with precision =>...

Displaying amount - Python [duplicate]

python,printing,currency,money
This question already has an answer here: Print without space in python 3 1 answer print("The cost of paint based on whole gallons is: $", round(paint_costs,2)) The cost of paint based on whole gallons is: $ XXX.XX How do I omit the space between the $ and amount so...

How to add money denominations c++

c++,money
very new programmer, I am having a difficult time trying to find a way to set up this problem. I have money denominations , one dollar through one hundred dollar. A user must input lets say for example 4 one dollar, and 5 five dollar, and receive a sum of...

More precision needed from SQL Server Money data type

sql,sql-server,asp-classic,sqldatatypes,money
I am working on this old SQL Server database which store numeric values in MONEY datatype. This has been good for years, now for some currency rate conversions we need up to 10 decimal places. We are exploring the possible conversion from MONEY datatype to DECIMAL. I see that a...

Sql Server select money with comma

sql-server,comma,money
I have Payment table in ms sql server. Payment table has below column type of money Salary Salary column has below values 1495.88 2235.08 719.59 15.75 9.59 0.00 NULL 97.77 When i select query as below, select Salary from Payment where Result must be below 1,495,88 2,235,08 719,59 15,75 9,59...

How to get the exchange currency exchange rate in rails?

ruby-on-rails,money,money-rails
I tried to get the exchange rate like this in my Rails app : 1.to_money.exchange_to('USD') (Note : I have set the default currency to my local currency which is lkr). This returns 0. Im using the money-rails gem....

how much profit from ads on Live wallpapers [closed]

android,advertising,live-wallpaper,money
i am developing a LW that is almost finished, i am wondering how much could this LW make money from ads assuming that I'll post 4 of them in the future & each will get more than 8000 downloads and knowing that this LW would run in the background, does...

toLocaleString() doesn't work in Safari browser

jquery,safari,comma,money
I used toLocaleString() method to input money comma in `javascript. But the problem is, IE and chrome browser result correctly except Safari browser. I delete cache several times but still doesn't work. Can you help? ;) var test = 12300; console.log('test:'+test.toLocaleString()); // 12,300 in IE,Chrome // 12300 in Safari ...

Ruby round numbers and paypal tax calculation

ruby,paypal,floating-point,decimal,money
I've issues rounding numbers while calculating tax. for example for amount 2.12 and a tax of 20%, I calculate it like follows: # this is on Numeric class def ceil_money (self * 100).ceil / 100.0 end ... amount = "2.12" ((Float(amount.to_f) * Float("20.0"))/100).ceil_money result is 0.43. To paypal I have...