Now my question is that how could be handle such a situation in erpnext.
--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/aberBNen3DQJ.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Aditya,Create a custom field of type Data. Say the fieldname is field_fraction.Assuming that the decimal fieldname is field_decimalNow, write a function like:cur_frm.cscript.field_fraction = function(doc) {// suppose value of field_fraction = 4/5// then value of field_decimal will be set as 0.8cur_frm.set_value(field_decimal, eval(doc.field_fraction));}Thanks,Anand.
On 20-Apr-2013, at 11:07 AM, Aditya Duggal <aditya...@gmail.com> wrote:
Hi,
I have been trying to figure out a way to capture data which is in fraction but honestly cannot really figure out which field to use and how to keep fractional and decimal data in the database.
Now my problem is that I am trying to capture some dimensions and as all of you might be aware that dimensions can be in various units but in my industry the dimensions are either in mm or inch.
Now till now we are capturing all the data in mm and not in inch we generally convert the inch data manually but this creates a lot of trouble. Now entering mm data is simple which happens to be a float but when it comes to Inch data capturing we are talking about fractions as well. Is it possible to capture the data in a form in Inch aka fractions and then save both the data in the table.
For example: we need to enter 1/2" then there are 2 ways of doing it:
- Easier way: Make a form with float input field and ask the user to convert the fraction into decimal and then enter the data.
- Benefit of this method is only one which is less coding for the developer.
- Tougher way: Make a form with FRACTION input field and ask the user to enter the fraction only, now there would be another field in decimal which would be hidden from the user and the code would be run to convert the fraction to the decimal and both the values would be saved.
Now my question is that how could be handle such a situation in erpnext.
--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/uAMUcW26bqkJ.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/uAMUcW26bqkJ.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/uAMUcW26bqkJ.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/UZiLjHzYeVMJ.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/UZiLjHzYeVMJ.